【问题标题】:Vuetity v-autocomplete and v-data-table are not workingVuetify v-autocomplete 和 v-data-table 不起作用
【发布时间】:2021-07-12 23:20:45
【问题描述】:

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 的版本并尝试添加/删除 node-sass,但没有任何成功。

【问题讨论】:

    标签: node.js vue.js npm sass vuetify.js


    【解决方案1】:

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

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

    yarn upgrade vuetify
    

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

    npm update vuetify
    

    【讨论】:

    • 感谢您的澄清。如果它再次发生,我会尝试更新,现在我设法让它在为项目服务之前使用npm install sass@1.32.8
    猜你喜欢
    • 1970-01-01
    • 2020-06-27
    • 1970-01-01
    • 1970-01-01
    • 2019-10-14
    • 2020-02-26
    • 2019-11-10
    • 2020-12-13
    • 2019-11-19
    相关资源
    最近更新 更多