-
Notifications
You must be signed in to change notification settings - Fork 9
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
2017 年 03 月,学习总结 #12
Comments
03 月 02 日一直以为都为 |
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> |
03 月 30 日Webpack
通过与 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'
}
export default {
name: 'app',
data () {
return {
msg: 'Welcome to Your Vue.js App'
}
},
mounted() {
debugger // 代码运行到此处会中断
console.log(111);
}
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
03 月 01 日
postcss-loader & autoprefixer
昨天一直在 webpack 1.0 配置 postcss-loader,但是 autoprefixer 死活没有生效,错误的配置代码如下:
谷歌了很久,尝试了很多修改,未果。后来发现要安装
autoprefixer
,于是:以为可以了,结果还是没效果,郁闷。
今早再次谷歌,突然发现我的 postcss 的位置写!错!了!
终于成功了!参考链接请戳这里。
The text was updated successfully, but these errors were encountered: