zoukankan      html  css  js  c++  java
  • vue 错误集

    [Vue warn]: You are setting a non-existent path "answer" on a vm instance. Consider pre-initializing the property with the "data" option for more reliable reactivity and better performance.

    说明:使用的变量“answer”没有初始化,需要再data里声明声明。

    [Vue warn]: Attributes "class", ":transition" are ignored on component <router-view> because the component is a fragment instance: http://vuejs.org/guide/components.html#Fragment-Instance

    官方说,出现实例片段的原因如下:

    1. Template contains multiple top-level elements. (模版包涵了多个顶级元素 说白了 你的模版元素没有唯一一个父元素)
    2. Template contains only plain text.(模版里面只包涵纯文本)
    3. Template contains only another component (which can potentially be a fragment instance itself).(模版只包含另外一个组件,而这个组件本上可以就是一个fragment instance)
    4. Template contains only an element directive, e.g. <partial> or vue-router’s<router-view>.(模版只包含<partial>或者<router-view>组件 )
    5. Template root node has a flow-control directive, e.g. v-if or v-for.(模版根节点被v-if活着v-for有个逻辑判断)
    1、模板包含多个顶级元素。
    2、模板只包含普通文本。
    3、模板只包含其它组件(其它组件可能是一个片段实例)。
    4、模板只包含一个元素指令,如 或 vue-router 的 。
    5、模板根节点有一个流程控制指令,如 v-if 或 v-for。

    [Vue warn]: Error when evaluating expression "function (vm) {

            return getter(vm.state);

          }": Error: [vuex] Do not mutate vuex store state outside mutation handlers.

     原因:在mutation外改变了state
    export const avatar = (state) => {
    state.user.avatar = appUser.avatar
    return state.user.avatar
    }
    正确写法:
    export const avatar = (state) => {
    return state.user.avatar
    }

    Uncaught TypeError: Cannot read property '__v_trans' of null

    说明: 这个vm实例没有指定el挂载点

    [vue-router] Uncaught error during transition:

    Uncaught TypeError: (0 , _dealHelper.getcStrategy) is not a function

    原因:

    router: {

        data () {

            //这里的代码出错

       }

    }

    Uncaught Error: no content is found

    我使用了vux的scroller,在scroller中做了个循环创建dom,如果没有创建的话就会报这个错误,可见,在scroller至少应该包含一个容器.

  • 相关阅读:
    在二元树中查找和为某一值的所有路径
    求整数的二进制表示1的个数
    Javascript AJAX 解析XML 兼容FIREFOX/IE
    DOM解析XML笔记
    Linux c 共享内存
    C Socket 发送/接收数据结构
    Linux c 获取系统内存
    7.5备忘
    linux c 唤醒进程 获取子进程结束状态
    7.1-7.2备忘
  • 原文地址:https://www.cnblogs.com/jun3101s/p/6007023.html
Copyright © 2011-2022 走看看