Vuetify v-autocomplete 和 v-data-table 不工作

Vuetity v-autocomplete and v-data-table are not working

Vue 和 Vuetify 在我之前的项目中运行得很好。但是现在为了测试一些东西,我尝试启动一个新项目 npm。我已经使用以下命令将 vuetify 添加到我的项目中:

> vue add vuetify

v-text-field 和 v-btn 可以正常工作,但是当我尝试使用更复杂的组件(例如 v-autocomplete 和 v-data-table 时,我得到了

98% after emitting CopyPlugin

 ERROR  Failed to compile with 1 error                                                                                                       4:46:43 PM

 error  in ./node_modules/vuetify/src/components/VSelect/VSelect.sass

Syntax Error: SassError: Expected identifier.
   ╷
68 │       position: relative
   │                         ^
   ╵
  node_modules\vuetify\src\components\VSelect\VSelect.sass 68:25  root stylesheet


 @ ./node_modules/vuetify/src/components/VSelect/VSelect.sass 4:14-206 15:3-20:5 16:22-214
 @ ./node_modules/vuetify/lib/components/VSelect/VSelect.js
 @ ./node_modules/vuetify/lib/components/VAutocomplete/VAutocomplete.js
 @ ./node_modules/vuetify/lib/components/VAutocomplete/index.js
 @ ./src/views/About.vue
 @ ./src/router/index.js
 @ ./src/main.js
 @ multi (webpack)-dev-server/client?http://192.168.1.157:8082&sockPath=/sockjs-node (webpack)/hot/dev-server.js ./src/main.js

我尝试更改 sass-loader 和 sass 的版本并尝试 add/remove node-sass,但没有取得任何成功。

我在尝试使用 v-select 时也遇到了类似的错误。 我看到的其他帖子建议做 ​​npm install sass@1.32.8,但它对我不起作用。

只需升级 vuetify 即可解决问题。

yarn upgrade vuetify

如果您使用的是 npm,则 运行 改为

npm update vuetify