Comments (3)
03 月 02 日
一直以为都为 node-sass
的安装而头疼,今天 google 到了不错的方法,妈妈再也不用担心我 npm 安装失败了。详情请戳这里。
from demo.
03 月 23 日
Vue
- 父组件调用子组件方法:
child.vue
<template>
<div>child</div>
</template>
<script>
export default {
methods: {
handleParentClick() {
console.log('parent click');
}
}
}:
</script>
parent.vue
<template>
<div>
<button @click="handleClick">点击</button>
<child ref="child"></child>
</div>
</template>
<script>
import Child from './child';
export default {
component: {
child: Child
},
methods: {
handleClick() {
this.$refs.child.handleParentClick();
}
}
};
</script>
from demo.
03 月 30 日
Webpack
- 尝试用 vue-cli 中的 webpack-simple 构建项目,发现 vue 单文件组件 sass-loader 的 sourceMap 没法定位到精确的位置(即具体的 sass 在 vue 文件中的行数,还有 @import 后 sass 文件里的代码行数)。
通过与 vue-cli 的 webpack 构建的 demo 比较,将以下代码改动以下即可使 sourceMap 准确定位 sass 代码。
修改前:
module.exports = {
module: {
rules: [
{
test: /\.vue$/,
loader: 'vue-loader',
options: {
loaders: {
'scss': 'vue-style-loader!css-loader!sass-loader'
}
}
}
]
},
devtool: '#eval-source-map'
}
修改后:
module.exports = {
module: {
rules: [
{
test: /\.vue$/,
loader: 'vue-loader',
options: {
loaders: {
'scss': {
loader: 'vue-style-loader?sourceMap!css-loader?sourceMap!sass-loader',
options: {
sourceMap: true
}
}
}
}
}
]
},
devtool: '#eval-source-map'
}
- 一直以来 vue 单文件组件在 chrome debug 我都需要先 console.log() 一句话,然后从 console 里找到相应的行数进去才能够 debug,突然发现了这一条特殊语句
debugger
,再也不用老是写 console.log() 来 debug 了。
export default {
name: 'app',
data () {
return {
msg: 'Welcome to Your Vue.js App'
}
},
mounted() {
debugger // 代码运行到此处会中断
console.log(111);
}
}
from demo.
Related Issues (13)
- 2016 年 05 月,学习总结 HOT 14
- 2016 年 06 月,学习总结 HOT 21
- 2016 年 07 月,学习总结 HOT 4
- 2016 年 08 月,学习总结 HOT 2
- 2016 年 09 月,学习总结
- 2016 年 10 月,学习总结 HOT 3
- 2016 年 11 月,学习总结 HOT 9
- 2016 年 12 月,学习总结 HOT 3
- 2017 年 01 月,学习总结 HOT 4
- 2017 年 02 月,学习总结 HOT 3
- 2017 年 04 月,学习总结 HOT 3
- 2017 年 08 月,学习总结 HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from demo.