From 024b166d5992679003469b52e6e9e47df07ab045 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=B0=B1=E7=9C=A0=E4=BB=AA=E5=BC=8F?= <854085467@qq.com> Date: Tue, 19 Oct 2021 14:49:26 +0800 Subject: [PATCH] =?UTF-8?q?fix(tab):=20=E9=80=89=E9=A1=B9=E5=8D=A1=20tab-i?= =?UTF-8?q?tem=20=E7=BB=84=E4=BB=B6=E5=A5=97=E7=94=A8=20for=20=E5=BE=AA?= =?UTF-8?q?=E7=8E=AF=E5=AF=BC=E8=87=B4=20props=20=E6=97=A0=E6=B3=95?= =?UTF-8?q?=E8=8E=B7=E5=8F=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/docs/zh-CN/guide/changelog.md | 1 + docs/docs/zh-CN/guide/sandbox.md | 20 ++++++++++++++++---- docs/src/layouts/Layout.vue | 2 +- package.json | 2 +- src/module/menu/index.vue | 12 ------------ src/module/tab/index.vue | 20 +++++++++++++++----- 6 files changed, 34 insertions(+), 23 deletions(-) diff --git a/docs/docs/zh-CN/guide/changelog.md b/docs/docs/zh-CN/guide/changelog.md index af9e9d5a..edee5760 100644 --- a/docs/docs/zh-CN/guide/changelog.md +++ b/docs/docs/zh-CN/guide/changelog.md @@ -7,6 +7,7 @@ [修复] menu 菜单 selectedKey 选中项 openKeys 打开项 props 双绑。
[修复] tab 选项卡 v-model 激活项 双绑。
+[修复] tab 选项卡 tab-item 组件套用 for 循环无法获取 props 属性。
[新增] page 分页 prev 插槽。
[新增] page 分页 next 插槽。
diff --git a/docs/docs/zh-CN/guide/sandbox.md b/docs/docs/zh-CN/guide/sandbox.md index 9512d4f8..be31f7d3 100644 --- a/docs/docs/zh-CN/guide/sandbox.md +++ b/docs/docs/zh-CN/guide/sandbox.md @@ -4,6 +4,7 @@ ::: demo @@ -34,18 +36,28 @@ export default { const router = useRouter(); const route = useRoute(); + const tabs = ref([{ + id:'1',title:'选项一' + },{ + id:'2',title:'选项二' + }]) + const isTree = ref(true); + const selectedKey = ref("1"); + const openKeys = ref(["0"]); + const change = function (id) { - selectedKey.value = id - }; + selectedKey.value = id + } return { isTree, selectedKey, openKeys, change, + tabs }; }, }; diff --git a/docs/src/layouts/Layout.vue b/docs/src/layouts/Layout.vue index 0144687d..dbdf46f8 100644 --- a/docs/src/layouts/Layout.vue +++ b/docs/src/layouts/Layout.vue @@ -31,7 +31,7 @@
  • - 0.1.4 + 0.1.6
  • diff --git a/package.json b/package.json index 9b1ae235..3d646102 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@layui/layui-vue", - "version": "0.1.4", + "version": "0.1.6", "description": "a component library for Vue 3 base on layui-vue", "main": "lib/layui-vue.umd.js", "module": "lib/layui-vue.es.js", diff --git a/src/module/menu/index.vue b/src/module/menu/index.vue index 75612067..46d331b3 100644 --- a/src/module/menu/index.vue +++ b/src/module/menu/index.vue @@ -44,18 +44,6 @@ const selectedKey = computed({ }, }) -watch(selectedKey, function (val) { - emit('update:selectedKey', val) -}) - -watch( - openKeys, - function (val) { - emit('update:openKeys', val) - }, - { deep: true } -) - provide('isTree', isTree) provide('selectedKey', selectedKey) provide('openKeys', openKeys) diff --git a/src/module/tab/index.vue b/src/module/tab/index.vue index f2e2a2c0..5968ddea 100644 --- a/src/module/tab/index.vue +++ b/src/module/tab/index.vue @@ -28,16 +28,18 @@ export default {