我正在Laravel和VueJS组件中使用Tailwind CSS。
<template>
</template>
<script>
</script>
<style lang="postcss" scoped>
.day-disabled {
@apply text-gray-400;
}
</style>
但是它抱怨
Module parse failed: Unexpected token (685:0)
File was processed with these loaders:
* ./node_modules/vue-loader/lib/index.js
You may need an additional loader to handle the result of these loaders.
|
|
> .day-disabled {
|
| @apply text-gray-400;
无论如何,在使用Laravel Mix的VueJS组件中是否可以使用@apply
指令。这是我的webpack.mix.js
const mix = require('laravel-mix');
mix.options({ extractVueStyles: true})
.js('resources/js/app.js','public/js')
.postCss('resources/css/app.css','public/css',[
require('postcss-import'),require('tailwindcss'),require('postcss-nested'),require('postcss-custom-properties'),require('autoprefixer')
]);
反正有解决此问题的方法。