很多事情自己经历了一遍,才会明白,看似简单的东西后面都隐藏很多不为人知艰辛。
今天去看了<<我不是药神>>,很感动,同时也感很无助,很渺小。有些事物很不被大众认可接受,但是却受法律保护,而做些为民有益的事情,却是违法。 相信比我大一些的人很多人怀念厦门某赖姓开车的好处,扯远了。
正题是VUE2.0中父子组件间传递值,网上很多,我只是工作需要,初入VUE,简单记录:
在rountes.js中加入:
import parent from './views/reportPlatform/parent.vue'
let routes = [
{ component: Home,
name: 'test',
iconCls: 'fa fa-file-text-o',
children: [ { path: '/parent', component: parent, name: 'parent' },
],
}
]
export default routes;
父组件 parent.vue:
<template>
<div id="test">父页面传入Product Type到子页面: {
{productType}}
<!-- :productType可以为任意名字,注意是冒号:开头,用来子组件获取父组件的值-->