Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug Report] 使用vux-loader之后所有vue组件script标签内的代码都会执行两次 #2868

Closed
ghost opened this issue Jun 20, 2018 · 4 comments

Comments

@ghost
Copy link

ghost commented Jun 20, 2018

VUX version

2.9.2

OS/Browsers version

MacOS Chrome

Vue version

2.5.16

Code

<template>
  <div id="app">
    hello world
  </div>
</template>

<script>
console.log('重复执行测试')
export default {
  name: 'App'
}
</script>

Steps to reproduce

  1. 通过vue-cli的webpack模版初始化一个空项目
  2. 在App.vue的<script>标签内添加console.log('重复执行测试')
  3. npm run dev将项目跑起来,在浏览器控制台查看,只打印了一行“重复执行测试”
  4. 安装vux和vux-loader,按照文档配置webpack,https://doc.vux.li/zh-CN/vux-loader/install.html
  5. 重新执行npm run dev将项目跑起来,在浏览器控制台查看,会打印两次“重复执行测试”

What is Expected?

vue组件script标签内的代码只会执行一次

What is actually happening?

vue组件script标签内的代码执行了二次

image

@weimingming
Copy link

我也遇到的同样的问题,求答案

@ghost
Copy link
Author

ghost commented Jun 27, 2018

@weimingming @airyland 我在vux-loader仓库也提了这个问题,求解答

@GzhiYi
Copy link

GzhiYi commented Sep 25, 2018

The same.

@Eurkidu
Copy link

Eurkidu commented Nov 15, 2018

vux-loader 的问题, 自己项目里面临时修改了下 vux-loader 的源代码解决了, 还是希望作者能修复下

具体见airyland/vux-loader#65 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants