Skip to content

Commit

Permalink
chore(ellipsis): split demo (#2847)
Browse files Browse the repository at this point in the history
  • Loading branch information
eiinu authored Jan 16, 2024
1 parent 485b11f commit 6635b7b
Show file tree
Hide file tree
Showing 16 changed files with 217 additions and 279 deletions.
11 changes: 11 additions & 0 deletions packages/nutui-taro-demo/src/exhibition/pages/ellipsis/end.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<template>
<nut-cell>
<nut-ellipsis direction="end" :content="content"></nut-ellipsis>
</nut-cell>
</template>
<script setup>
import { ref } from 'vue';
const content = ref(
'NutUI3.0上线后我们研发团队也在不断的优化、测试、使用、迭代 Vue3 的相关组件,但是在跨端小程序的开发过程中,发现没有合适的组件库可以支持多端开发。为了填补这一空白,同时为了优化开发者体验,让 NutUI 能够为更多的开发者带来便利,我们决定在 NutUI 中增加小程序多端适配的能力。'
);
</script>
18 changes: 18 additions & 0 deletions packages/nutui-taro-demo/src/exhibition/pages/ellipsis/expand.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<template>
<nut-cell>
<nut-ellipsis :content="content" direction="start" expand-text="展开" collapse-text="收起"></nut-ellipsis>
</nut-cell>
<nut-cell>
<nut-ellipsis :content="content" direction="middle" expand-text="展开" collapse-text="收起"></nut-ellipsis>
</nut-cell>
<nut-cell>
<nut-ellipsis :content="content" direction="end" rows="3" expand-text="展开" collapse-text="收起"></nut-ellipsis>
</nut-cell>
</template>

<script setup>
import { ref } from 'vue';
const content = ref(
'NutUI3.0上线后我们研发团队也在不断的优化、测试、使用、迭代 Vue3 的相关组件,但是在跨端小程序的开发过程中,发现没有合适的组件库可以支持多端开发。为了填补这一空白,同时为了优化开发者体验,让 NutUI 能够为更多的开发者带来便利,我们决定在 NutUI 中增加小程序多端适配的能力。'
);
</script>
63 changes: 33 additions & 30 deletions packages/nutui-taro-demo/src/exhibition/pages/ellipsis/index.vue
Original file line number Diff line number Diff line change
@@ -1,40 +1,43 @@
<template>
<Demo>
<h2>头部省略</h2>
<nut-cell>
<nut-ellipsis :content="content" direction="start" class="elli"></nut-ellipsis>
</nut-cell>
<h2>{{ t('start') }}</h2>
<Start />

<h2>尾部省略</h2>
<nut-cell>
<nut-ellipsis :content="content" direction="end" class="elli"></nut-ellipsis>
</nut-cell>
<h2>{{ t('end') }}</h2>
<End />

<h2>中间省略</h2>
<nut-cell>
<nut-ellipsis :content="content" direction="middle" class="elli"></nut-ellipsis>
</nut-cell>
<h2>{{ t('middle') }}</h2>
<Middle />

<h2>多行省略</h2>
<nut-cell>
<nut-ellipsis :content="content" direction="start" rows="3"></nut-ellipsis>
</nut-cell>
<h2>{{ t('row') }}</h2>
<Row />

<h2>展开收起</h2>
<nut-cell>
<nut-ellipsis :content="content" direction="start" expand-text="展开" collapse-text="收起"></nut-ellipsis>
</nut-cell>
<nut-cell>
<nut-ellipsis :content="content" direction="middle" expand-text="展开" collapse-text="收起"></nut-ellipsis>
</nut-cell>
<nut-cell>
<nut-ellipsis :content="content" direction="end" rows="3" expand-text="展开" collapse-text="收起"></nut-ellipsis>
</nut-cell>
<h2>{{ t('expand') }}</h2>
<Expand />
</Demo>
</template>
<script setup lang="ts">
import { ref } from 'vue';
const content = ref(
'NutUI3.0上线后我们研发团队也在不断的优化、测试、使用、迭代 Vue3 的相关组件,但是在跨端小程序的开发过程中,发现没有合适的组件库可以支持多端开发。为了填补这一空白,同时为了优化开发者体验,让 NutUI 能够为更多的开发者带来便利,我们决定在 NutUI 中增加小程序多端适配的能力。'
);
import { useTranslate } from '../../../utils';
import Start from './start.vue';
import End from './end.vue';
import Middle from './middle.vue';
import Row from './row.vue';
import Expand from './expand.vue';
const t = useTranslate({
'zh-CN': {
start: '头部省略',
end: '尾部省略',
middle: '中间省略',
row: '多行省略',
expand: '展开收起'
},
'en-US': {
start: 'Start',
end: 'End',
middle: 'Middle',
row: 'Multi-line',
expand: 'Expand & Collapse'
}
});
</script>
11 changes: 11 additions & 0 deletions packages/nutui-taro-demo/src/exhibition/pages/ellipsis/middle.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<template>
<nut-cell>
<nut-ellipsis direction="middle" :content="content"></nut-ellipsis>
</nut-cell>
</template>
<script setup>
import { ref } from 'vue';
const content = ref(
'NutUI3.0上线后我们研发团队也在不断的优化、测试、使用、迭代 Vue3 的相关组件,但是在跨端小程序的开发过程中,发现没有合适的组件库可以支持多端开发。为了填补这一空白,同时为了优化开发者体验,让 NutUI 能够为更多的开发者带来便利,我们决定在 NutUI 中增加小程序多端适配的能力。'
);
</script>
11 changes: 11 additions & 0 deletions packages/nutui-taro-demo/src/exhibition/pages/ellipsis/row.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<template>
<nut-cell>
<nut-ellipsis direction="start" :content="content" :rows="3"></nut-ellipsis>
</nut-cell>
</template>
<script setup>
import { ref } from 'vue';
const content = ref(
'NutUI3.0上线后我们研发团队也在不断的优化、测试、使用、迭代 Vue3 的相关组件,但是在跨端小程序的开发过程中,发现没有合适的组件库可以支持多端开发。为了填补这一空白,同时为了优化开发者体验,让 NutUI 能够为更多的开发者带来便利,我们决定在 NutUI 中增加小程序多端适配的能力。'
);
</script>
11 changes: 11 additions & 0 deletions packages/nutui-taro-demo/src/exhibition/pages/ellipsis/start.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<template>
<nut-cell>
<nut-ellipsis direction="start" :content="content"></nut-ellipsis>
</nut-cell>
</template>
<script setup>
import { ref } from 'vue';
const content = ref(
'NutUI3.0上线后我们研发团队也在不断的优化、测试、使用、迭代 Vue3 的相关组件,但是在跨端小程序的开发过程中,发现没有合适的组件库可以支持多端开发。为了填补这一空白,同时为了优化开发者体验,让 NutUI 能够为更多的开发者带来便利,我们决定在 NutUI 中增加小程序多端适配的能力。'
);
</script>
58 changes: 0 additions & 58 deletions src/packages/__VUE/ellipsis/demo.vue

This file was deleted.

11 changes: 11 additions & 0 deletions src/packages/__VUE/ellipsis/demo/end.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<template>
<nut-cell>
<nut-ellipsis direction="end" :content="content"></nut-ellipsis>
</nut-cell>
</template>
<script setup>
import { ref } from 'vue';
const content = ref(
'NutUI3.0上线后我们研发团队也在不断的优化、测试、使用、迭代 Vue3 的相关组件,但是在跨端小程序的开发过程中,发现没有合适的组件库可以支持多端开发。为了填补这一空白,同时为了优化开发者体验,让 NutUI 能够为更多的开发者带来便利,我们决定在 NutUI 中增加小程序多端适配的能力。'
);
</script>
18 changes: 18 additions & 0 deletions src/packages/__VUE/ellipsis/demo/expand.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<template>
<nut-cell>
<nut-ellipsis :content="content" direction="start" expand-text="展开" collapse-text="收起"></nut-ellipsis>
</nut-cell>
<nut-cell>
<nut-ellipsis :content="content" direction="middle" expand-text="展开" collapse-text="收起"></nut-ellipsis>
</nut-cell>
<nut-cell>
<nut-ellipsis :content="content" direction="end" rows="3" expand-text="展开" collapse-text="收起"></nut-ellipsis>
</nut-cell>
</template>

<script setup>
import { ref } from 'vue';
const content = ref(
'NutUI3.0上线后我们研发团队也在不断的优化、测试、使用、迭代 Vue3 的相关组件,但是在跨端小程序的开发过程中,发现没有合适的组件库可以支持多端开发。为了填补这一空白,同时为了优化开发者体验,让 NutUI 能够为更多的开发者带来便利,我们决定在 NutUI 中增加小程序多端适配的能力。'
);
</script>
43 changes: 43 additions & 0 deletions src/packages/__VUE/ellipsis/demo/index.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
<template>
<Demo>
<h2>{{ t('start') }}</h2>
<Start />

<h2>{{ t('end') }}</h2>
<End />

<h2>{{ t('middle') }}</h2>
<Middle />

<h2>{{ t('row') }}</h2>
<Row />

<h2>{{ t('expand') }}</h2>
<Expand />
</Demo>
</template>
<script setup lang="ts">
import { useTranslate } from '@/sites/utils';
import Start from './start.vue';
import End from './end.vue';
import Middle from './middle.vue';
import Row from './row.vue';
import Expand from './expand.vue';
const t = useTranslate({
'zh-CN': {
start: '头部省略',
end: '尾部省略',
middle: '中间省略',
row: '多行省略',
expand: '展开收起'
},
'en-US': {
start: 'Start',
end: 'End',
middle: 'Middle',
row: 'Multi-line',
expand: 'Expand & Collapse'
}
});
</script>
11 changes: 11 additions & 0 deletions src/packages/__VUE/ellipsis/demo/middle.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<template>
<nut-cell>
<nut-ellipsis direction="middle" :content="content"></nut-ellipsis>
</nut-cell>
</template>
<script setup>
import { ref } from 'vue';
const content = ref(
'NutUI3.0上线后我们研发团队也在不断的优化、测试、使用、迭代 Vue3 的相关组件,但是在跨端小程序的开发过程中,发现没有合适的组件库可以支持多端开发。为了填补这一空白,同时为了优化开发者体验,让 NutUI 能够为更多的开发者带来便利,我们决定在 NutUI 中增加小程序多端适配的能力。'
);
</script>
11 changes: 11 additions & 0 deletions src/packages/__VUE/ellipsis/demo/row.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<template>
<nut-cell>
<nut-ellipsis direction="start" :content="content" :rows="3"></nut-ellipsis>
</nut-cell>
</template>
<script setup>
import { ref } from 'vue';
const content = ref(
'NutUI3.0上线后我们研发团队也在不断的优化、测试、使用、迭代 Vue3 的相关组件,但是在跨端小程序的开发过程中,发现没有合适的组件库可以支持多端开发。为了填补这一空白,同时为了优化开发者体验,让 NutUI 能够为更多的开发者带来便利,我们决定在 NutUI 中增加小程序多端适配的能力。'
);
</script>
11 changes: 11 additions & 0 deletions src/packages/__VUE/ellipsis/demo/start.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<template>
<nut-cell>
<nut-ellipsis direction="start" :content="content"></nut-ellipsis>
</nut-cell>
</template>
<script setup>
import { ref } from 'vue';
const content = ref(
'NutUI3.0上线后我们研发团队也在不断的优化、测试、使用、迭代 Vue3 的相关组件,但是在跨端小程序的开发过程中,发现没有合适的组件库可以支持多端开发。为了填补这一空白,同时为了优化开发者体验,让 NutUI 能够为更多的开发者带来便利,我们决定在 NutUI 中增加小程序多端适配的能力。'
);
</script>
Loading

0 comments on commit 6635b7b

Please sign in to comment.