From 8f69e63c776e1bb583b775078c3dd13b4c1dd8d4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=90=95=E5=BA=86=E5=AE=89?= Date: Tue, 9 May 2017 15:04:59 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=AD=A3table=20render=E7=9A=84?= =?UTF-8?q?=E7=BB=84=E4=BB=B6=E4=B8=AD=E6=97=A0=E6=B3=95=E8=8E=B7=E5=8F=96?= =?UTF-8?q?this.$store=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 在table的render中生成的组件,组件内部无法通过this.$store来获取vuex对象 --- src/components/table/cell.vue | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/components/table/cell.vue b/src/components/table/cell.vue index 65bf8b9c..7efb951f 100644 --- a/src/components/table/cell.vue +++ b/src/components/table/cell.vue @@ -96,6 +96,9 @@ }, components: components }); + if ($parent.$store != undefined) { + component.$store = $parent.$store; + } component.row = this.row; component.column = this.column;