相关疑难解决方法(0)

VueJS错误避免直接更改道具

我正在尝试创建一个模态,但是只有在关闭它时才出现此错误:

[Vue warn]: Avoid mutating a prop directly since the value will be overwritten whenever the parent component re-renders. Instead, use a data or computed property based on the prop's value. Prop being mutated: "value"

found in

---> <PanelDesconectarModal> at resources\assets\vue\PanelDesconectarModal.vue
       <VNavigationDrawer>
         <PanelDrawer> at resources\assets\vue\PanelDrawer.vue
           <VApp>
             <PanelRoot> at resources\assets\vue\PanelRoot.vue
               <VApp>
                 <Root>
Run Code Online (Sandbox Code Playgroud)

PanelDesconectarModal.vue

<template>
    <v-dialog v-model="value" max-width="350">
        <v-card :dark="($theme === 'dark')">
            <v-card-title class="headline">Desconectar</v-card-title>
            <v-divider></v-divider>
            <v-card-text>Você tem certeza que deseja desconectar-se?</v-card-text>
            <v-card-actions>
                <v-spacer></v-spacer>
                <v-btn flat @click.native="closeDialog">Cancelar</v-btn>
                <v-btn :color="$color" flat="flat" @click.native="desconectar">Desconectar</v-btn>
            </v-card-actions>
        </v-card> …
Run Code Online (Sandbox Code Playgroud)

vue.js vuejs2 vuetify.js

3
推荐指数
1
解决办法
7679
查看次数

Vuetify:v模型看起来已过时

我正在使用Vuetify 1.0.14创建我的应用程序。虽然我加载页面时,却收到以下错误消息:

vuetify.js?dc48:19429 [Vuetify] v-model has been deprecated

found in

---> <VExpansionPanelContent>
Run Code Online (Sandbox Code Playgroud)

这些是此警告消息所引用的代码行:

            <v-expansion-panel>
                <v-expansion-panel-content key="annotations" :value="sideFocusItem.default === 'annotations'">
                    <div slot="header">Annotations:</div>
                    <annotations v-if="loadAnnotationBuilder"></annotations>
                </v-expansion-panel-content>
            </v-expansion-panel>
Run Code Online (Sandbox Code Playgroud)

我很难弄清楚在哪里v-model使用了它,以及有可能不推荐使用它。这只是一个警告,但是我该如何解决?

vue.js vuetify.js

1
推荐指数
1
解决办法
3315
查看次数

标签 统计

vue.js ×2

vuetify.js ×2

vuejs2 ×1