点击'关于'完全没反应还报错

来源:6-8 首页 - 登录

qq_上帝之手_3

2017-12-09

vue.esm.js?a915:574 [Vue warn]: Error in nextTick: "TypeError: Cannot read property '_withTask' of undefined"

warn @ vue.esm.js?a915:574

logError @ vue.esm.js?a915:1695

globalHandleError @ vue.esm.js?a915:1690

handleError @ vue.esm.js?a915:1679

(anonymous) @ vue.esm.js?a915:1797

flushCallbacks @ vue.esm.js?a915:1716

vue.esm.js?a915:1699 TypeError: Cannot read property '_withTask' of undefined

    at remove$2 (vue.esm.js?a915:6920)

    at updateListeners (vue.esm.js?a915:2023)

    at Array.updateDOMListeners (vue.esm.js?a915:6933)

    at patchVnode (vue.esm.js?a915:5787)

    at updateChildren (vue.esm.js?a915:5689)

    at patchVnode (vue.esm.js?a915:5792)

    at updateChildren (vue.esm.js?a915:5689)

    at patchVnode (vue.esm.js?a915:5792)

    at updateChildren (vue.esm.js?a915:5689)

    at patchVnode (vue.esm.js?a915:5792)

//以上是报错的地方



//下面是dialog.vue的代码

<template>

<div>

<div class="dialog-wrap" v-if="isShow">

<!-- 遮罩 -->

<div class="dialog-cover" @click="closeMyself"></div>

<transition name="drop">

<div class="dialog-content">

<p class="dialog-close" @click="closeMyself">&times;</p>

<!-- hello -->

<!-- 插槽 -->

<slot>empty</slot>

</div>

</transition>

</div>

</div>

</template>


<script>

export default {

props: {

isShow: {

type: Boolean,

default: false //默认关闭

}

},

data() {

return {};

},

methods: {

closeMyself() {

this.$emit("on-close");

}

}

};

</script>


<style scoped>

.drop-enter-active {

transition: all 0.5s ease;

}

.drop-leave-active {

transition: all 0.3s ease;

}

.drop-enter {

transform: translateY(-500px);

}

.drop-leave-active {

transform: translateY(-500px);

}


.dialog-wrap {

position: fixed;

width: 100%;

height: 100%;

}

.dialog-cover {

background: #000;

opacity: 0.3;

position: fixed;

z-index: 5;

top: 0;

left: 0;

width: 100%;

height: 100%;

}

.dialog-content {

width: 50%;

position: fixed;

max-height: 50%;

overflow: auto;

background: #fff;

top: 20%;

left: 50%;

margin-left: -25%;

z-index: 10;

border: 2px solid #464068;

padding: 2%;

line-height: 1.6;

}

.dialog-close {

position: absolute;

right: 5px;

top: 5px;

width: 20px;

height: 20px;

text-align: center;

cursor: pointer;

}

.dialog-close:hover {

color: #4fc08d;

}

</style>


//下面是layout.vue的代码

<template>

<div>

<div class="app-head">

<div class="app-head-inner">

<router-link :to="{path:'/'}">

<img src="../assets/logo.png" alt="">

</router-link>

<div class="head-nav">

<ul class="nav-list">

<li>{{username}}</li>

<li v-if="username!==''" class="nav-pile">|</li>

<li v-if="username!==''" @click="quit">退出</li>

<li v-if="username===''" @click="logoClick">登录</li>

<li class="nav-pile">|</li>

<li v-if="username===''" @click="regClick">注册</li>

<li v-if="username===''" class="nav-pile">|</li>

<li @click="aboutClick">关于</li>

</ul>

</div>

</div>

</div>

<div class="app-content">

<!-- keep-alive把访问过的页面进行缓存 -->

<keep-alive>

<router-view></router-view>

</keep-alive>

</div>

<div class="app-foot">

<p>© 2016 fishenal MIT</p>

</div>

<my-dialog :is-show="isShowAboutDialog" @on-close="closeDialog('isShowAboutDialog')"><p>other hello</p></my-dialog>


</div>

</template>


<script>

import Dialog from './dialog';//同级的

// import LogForm from './logForm';

// import RegForm from './regForm';

export default {

components:{

MyDialog: Dialog,

},

created:function () {//组件创建完毕后get请求数据

//this.$http.get('getList')

},

data(){

return{

isShowAboutDialog: false,

//username:""

}

},

methods:{

aboutClick () {

this.isShowAboutDialog = true;

//alert("111");

},

closeDialog (attr) {

this[attr] = false

},

},


}

</script>


<style>

/* 复位样式 */

/* http://meyerweb.com/eric/tools/css/reset/

  v2.0 | 20110126

  License: none (public domain)

*/


html, body, div, span, applet, object, iframe,

h1, h2, h3, h4, h5, h6, p, blockquote, pre,

a, abbr, acronym, address, big, cite, code,

del, dfn, em, img, ins, kbd, q, s, samp,

small, strike, strong, sub, sup, tt, var,

b, u, i, center,

dl, dt, dd, ol, ul, li,

fieldset, form, label, legend,

table, caption, tbody, tfoot, thead, tr, th, td,

article, aside, canvas, details, embed,

figure, figcaption, footer, header, hgroup,

menu, nav, output, ruby, section, summary,

time, mark, audio, video {

margin: 0;

padding: 0;

border: 0;

font-size: 100%;

font: inherit;

vertical-align: baseline;

}

/* HTML5 display-role reset for older browsers */

article, aside, details, figcaption, figure,

footer, header, hgroup, menu, nav, section {

display: block;

}

body {

line-height: 1;

}

ol, ul {

list-style: none;

}

blockquote, q {

quotes: none;

}

blockquote:before, blockquote:after,

q:before, q:after {

content: '';

content: none;

}

table {

border-collapse: collapse;

border-spacing: 0;

}

a {

color: inherit;

text-decoration: none;

}

body {

background: #f0f2f5;

font-family: "Helvetica Neue",Helvetica,Arial,"Hiragino Sans GB","Hiragino Sans GB W3","Microsoft YaHei UI","Microsoft YaHei","WenQuanYi Micro Hei",sans-serif;

font-size: 14px;

color: #444;

}

.app-head {

background: #363636;

color: #b2b2b2;

height: 90px;

line-height: 90px;

width: 100%;

}

.app-head-inner {

width: 1200px;

margin: 0 auto;

}

.head-logo {

float: left;

}

.app-head-inner img {

width: 50px;

margin-top: 20px;

}

.head-nav {

float: right;

}

.head-nav ul {

overflow: hidden;

}

.head-nav li {

cursor: pointer;

float: left;

}

.nav-pile {

padding: 0 10px;

}

.app-foot {

text-align: center;

height: 80px;

width: 100%;

line-height: 80px;

background: #e3e4e8;

clear: both;

margin-top: 30px;

}

.container {

width: 1200px;

margin: 0 auto;

}

.hr {

height: 1px;

width: 100%;

background: #ddd;

}

.button {

background: #4fc08d;

color: #fff;

display: inline-block;

padding: 10px 20px;

cursor: pointer;

}

.button:hover {

background: #4fc08d;

}

.g-form {


}

.g-form-line {

padding: 15px 0;

}

.g-form-label {

width: 100px;

font-size: 16px;

display: inline-block;

}

.g-form-input {

display: inline-block;

}

.g-form-input input {

height: 30px;

width: 200px;

line-height: 30px;

vertical-align: middle;

padding: 0 10px;

border: 1px solid #ccc;

}

.g-form-btn {

padding-left: 100px;

}

.g-form-error {

color: red;

padding-left: 15px;

}


</style>



写回答

1回答

fishenal

2017-12-11

代码太长了没法肉眼调试,你的问题应该是报错卡住了 代码,简单看了一下代码没发现什么问题,v-if还是按照我原来的写法放到wrap里比较好。报错也没具体定位,你删掉一些可能出错的地方,排查一下

0
0

最容易上手的Vue2.0入门实战教程

快速入门Vue2.0,组件化开发一个数字产品电商平台

3966 学习 · 999 问题

查看课程