From 261f4a7a13b5e5c3d316f8cbfe8202d27827ad88 Mon Sep 17 00:00:00 2001 From: Pay Duyen Date: Mon, 25 Nov 2019 16:11:37 +0700 Subject: [PATCH 1/9] List render listItem --- src/components/GList/GList.vue | 207 ++++++++++-------- src/components/GList/GListItem.vue | 65 +++--- .../GList/__story__/GList.stories.js | 33 +++ 3 files changed, 180 insertions(+), 125 deletions(-) diff --git a/src/components/GList/GList.vue b/src/components/GList/GList.vue index c7c5808b..f8b3a500 100644 --- a/src/components/GList/GList.vue +++ b/src/components/GList/GList.vue @@ -5,102 +5,106 @@ @click="onClick" ref="list" > - diff --git a/src/components/GList/__story__/GList.stories.js b/src/components/GList/__story__/GList.stories.js index 13654fb2..8d1d70c0 100644 --- a/src/components/GList/__story__/GList.stories.js +++ b/src/components/GList/__story__/GList.stories.js @@ -65,6 +65,7 @@ export const gListPlayGround = () => ({ :divider="divider" :prependType="prependType" :subtitleWrap="subtitleWrap" + :itemTitle="itemTitle" /> `, }) @@ -669,6 +670,38 @@ export const gListAsMenuContent = () => ({ `, }) +export const gListFreeRender = () => ({ + components: { GList, GIcon, GListItemIcon, GContainer, GDivider, GRow, GBtn, GListItem, GListItemContent }, + data() { + return { + testValue: null, + items:[ + {text: 'item1', value: 1}, + {text: 'item2', value: 2}, + {text: 'item3', value: 3}, + ] + } + }, + + template: + ` +
+ {{testValue}} + +
`, +}) import Vue from 'vue/dist/vue.common.js' import GContainer from '../../GLayout/GContainer'; import GRow from '../../GLayout/GRow'; From 510c444dc5743cf614e635040ca531fd15923222 Mon Sep 17 00:00:00 2001 From: Pay Duyen Date: Mon, 25 Nov 2019 16:12:05 +0700 Subject: [PATCH 2/9] List render listItem --- .../__snapshots__/1-Button.stories.js.snap | 74 +++++++++++++++++++ 1 file changed, 74 insertions(+) diff --git a/src/components/GBtn/__story__/__snapshots__/1-Button.stories.js.snap b/src/components/GBtn/__story__/__snapshots__/1-Button.stories.js.snap index aa6bda0d..46b4a436 100644 --- a/src/components/GBtn/__story__/__snapshots__/1-Button.stories.js.snap +++ b/src/components/GBtn/__story__/__snapshots__/1-Button.stories.js.snap @@ -7,3 +7,77 @@ exports[`test should test1 1`] = ` XLARGE BUTTON `; + +exports[`test should test1 2`] = ` + +`; + +exports[`test should test1 3`] = ` + +`; + +exports[`test should test1 4`] = ` + +`; + +exports[`test should test1 5`] = ` + +`; + +exports[`test should test1 6`] = ` + +`; + +exports[`test should test1 7`] = ` + +`; + +exports[`test should test1 8`] = ` + +`; From a74f3d7536999a3f10596c83aa9cabd228143c0f Mon Sep 17 00:00:00 2001 From: Pay Duyen Date: Mon, 25 Nov 2019 16:16:01 +0700 Subject: [PATCH 3/9] code refactor --- src/components/GList/GList.vue | 96 ++++++++++++++++++---------------- 1 file changed, 52 insertions(+), 44 deletions(-) diff --git a/src/components/GList/GList.vue b/src/components/GList/GList.vue index f8b3a500..84e3d57b 100644 --- a/src/components/GList/GList.vue +++ b/src/components/GList/GList.vue @@ -1,10 +1,10 @@