Skip to content

Commit

Permalink
chore: remove create-demo (jd-opensource#2404)
Browse files Browse the repository at this point in the history
  • Loading branch information
eiinu authored Jul 10, 2023
1 parent 3492f5e commit 3af2950
Show file tree
Hide file tree
Showing 86 changed files with 522 additions and 353 deletions.
40 changes: 7 additions & 33 deletions jd/demo.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,10 @@ export default create({
</nut-cell>
</div>
</template>
<script lang="ts">
<script setup lang="ts">
import { defineComponent } from 'vue';
import { createComponent } from '@/packages/utils/create';
const { createDemo, translate } = createComponent('${nameLc}');
const { translate } = createComponent('${nameLc}');
import { useTranslate } from '@/sites/assets/util/useTranslate';
const initTranslate = () => useTranslate({
'zh-CN': {
Expand All @@ -59,18 +60,8 @@ const initTranslate = () => useTranslate({
basic: 'Basic Usage'
}
})
export default createDemo({
props: {},
setup() {
initTranslate();
return { translate };
}
});
initTranslate();
</script>
<style lang="scss" scoped>
.demo{
}
</style>
`,
taroDemo: `<template>
<div class="demo">
Expand All @@ -80,14 +71,7 @@ export default createDemo({
</nut-cell>
</div>
</template>
<script lang="ts">
import { defineComponent } from 'vue';
export default defineComponent({
props: {},
setup() {
return {};
}
});
<script setup lang="ts">
</script>
`,
doc: `# ${nameLc}
Expand Down Expand Up @@ -119,12 +103,7 @@ app.use();
<template>
</template>
<script lang="ts">
export default {
setup() {
return { };
}
};
<script setup>
</script>
\`\`\`
Expand Down Expand Up @@ -171,12 +150,7 @@ app.use();
<template>
</template>
<script lang="ts">
export default {
setup() {
return { };
}
};
<script setup>
</script>
\`\`\`
Expand Down
9 changes: 6 additions & 3 deletions src/packages/__VUE/actionsheet/demo.vue
Original file line number Diff line number Diff line change
Expand Up @@ -79,9 +79,9 @@
</template>

<script lang="ts">
import { computed, reactive } from 'vue';
import { computed, reactive, defineComponent } from 'vue';
import { createComponent } from '@/packages/utils/create';
const { createDemo, translate } = createComponent('action-sheet');
const { translate } = createComponent('action-sheet');
import { useTranslate } from '@/sites/assets/util/useTranslate';
const initTranslate = () =>
useTranslate({
Expand Down Expand Up @@ -127,7 +127,7 @@ interface Item {
disable?: boolean;
loading?: boolean;
}
export default createDemo({
export default defineComponent({
props: {},
setup() {
initTranslate();
Expand Down Expand Up @@ -222,12 +222,15 @@ export default createDemo({
padding: 110px 0;
text-align: center;
}
.nut-cell {
justify-content: space-between;
}
.custom-content {
padding: 10px 10px 160px;
}
.nut-theme-dark {
.custom-content {
color: white;
Expand Down
8 changes: 5 additions & 3 deletions src/packages/__VUE/address/demo.vue
Original file line number Diff line number Diff line change
Expand Up @@ -102,9 +102,9 @@

<script lang="ts">
import { createComponent } from '@/packages/utils/create';
import { onMounted, reactive, ref, toRefs } from 'vue';
import { onMounted, reactive, ref, toRefs, defineComponent } from 'vue';
import { useTranslate } from '@/sites/assets/util/useTranslate';
const { createDemo, translate } = createComponent('address');
const { translate } = createComponent('address');
import { HeartFill, Heart1, Close } from '@nutui/icons-vue';
const initTranslate = () =>
Expand Down Expand Up @@ -163,7 +163,7 @@ interface AddressResult extends AddressList {
country: RegionData[];
town: RegionData[];
}
export default createDemo({
export default defineComponent({
props: {},
components: { HeartFill, Heart1, Close },
setup() {
Expand Down Expand Up @@ -395,11 +395,13 @@ export default createDemo({
}
}
}
.nut-address-custom-buttom {
width: 100%;
height: 54px;
padding: 6px 0px 0;
border-top: 1px solid #f2f2f2;
.btn {
width: 90%;
height: 42px;
Expand Down
6 changes: 3 additions & 3 deletions src/packages/__VUE/addresslist/demo.vue
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@

<script lang="ts">
import { createComponent } from '@/packages/utils/create';
import { reactive, ref } from 'vue';
const { createDemo, translate } = createComponent('address-list');
import { reactive, ref, defineComponent } from 'vue';
const { translate } = createComponent('address-list');
import { useTranslate } from '@/sites/assets/util/useTranslate';
const initTranslate = () =>
useTranslate({
Expand All @@ -58,7 +58,7 @@ const initTranslate = () =>
title2: 'Swipe Function'
}
});
export default createDemo({
export default defineComponent({
props: {},
setup() {
initTranslate();
Expand Down
4 changes: 2 additions & 2 deletions src/packages/__VUE/animate/demo.vue
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@
<script lang="ts">
import { createComponent } from '@/packages/utils/create';
const { createDemo, translate } = createComponent('animate');
const { translate } = createComponent('animate');
import { useTranslate } from '@/sites/assets/util/useTranslate';
const initTranslate = () =>
Expand Down Expand Up @@ -109,7 +109,7 @@ const initTranslate = () =>
float: 'float-float'
}
});
export default createDemo({
export default defineComponent({
props: {},
setup() {
initTranslate();
Expand Down
7 changes: 4 additions & 3 deletions src/packages/__VUE/audio/demo.vue
Original file line number Diff line number Diff line change
Expand Up @@ -75,9 +75,9 @@
</template>

<script lang="ts">
import { reactive, toRefs, ref, onMounted } from 'vue';
import { reactive, toRefs, ref, onMounted, defineComponent } from 'vue';
import { createComponent } from '@/packages/utils/create';
const { createDemo, translate } = createComponent('audio');
const { translate } = createComponent('audio');
import { useTranslate } from '@/sites/assets/util/useTranslate';
import { PlayDoubleBack, PlayDoubleForward, PlayStart, PlayStop, Voice } from '@nutui/icons-vue';
const initTranslate = () =>
Expand All @@ -96,7 +96,7 @@ const initTranslate = () =>
}
});
export default createDemo({
export default defineComponent({
props: {},
components: {
Voice,
Expand Down Expand Up @@ -177,6 +177,7 @@ export default createDemo({
}
}
}
.demo {
.nut-voice {
display: flex;
Expand Down
54 changes: 40 additions & 14 deletions src/packages/__VUE/avatar/demo.vue
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,12 @@
</nut-cell>
<h2>{{ translate('title2') }}</h2>
<nut-cell>
<nut-avatar shape="square"><My /></nut-avatar>
<nut-avatar shape="round"><My /></nut-avatar>
<nut-avatar shape="square">
<My />
</nut-avatar>
<nut-avatar shape="round">
<My />
</nut-avatar>
</nut-cell>
<h2>{{ translate('title3') }}</h2>
<nut-cell>
Expand All @@ -30,21 +34,29 @@
src="https://img12.360buyimg.com/imagetools/jfs/t1/196430/38/8105/14329/60c806a4Ed506298a/e6de9fb7b8490f38.png"
/>
</nut-avatar>
<nut-avatar><My /></nut-avatar>
<nut-avatar>
<My />
</nut-avatar>
<nut-avatar>王</nut-avatar>
</nut-cell>
<h2>{{ translate('title4') }}</h2>
<nut-cell>
<nut-avatar class="demo-avatar" bg-color="#FA2C19"><My color="#fff" /></nut-avatar>
<nut-avatar class="demo-avatar" bg-color="#FA2C19">
<My color="#fff" />
</nut-avatar>
<nut-avatar color="rgb(245, 106, 0)" bg-color="rgb(253, 227, 207)">小明</nut-avatar>
</nut-cell>
<h2>{{ translate('title5') }}</h2>
<nut-cell>
<nut-badge value="8">
<nut-avatar shape="square"><My /></nut-avatar>
<nut-avatar shape="square">
<My />
</nut-avatar>
</nut-badge>
<nut-badge dot>
<nut-avatar shape="square"><My /></nut-avatar>
<nut-avatar shape="square">
<My />
</nut-avatar>
</nut-badge>
</nut-cell>
<h2>{{ translate('title6') }}</h2>
Expand All @@ -55,7 +67,9 @@
src="https://img12.360buyimg.com/imagetools/jfs/t1/196430/38/8105/14329/60c806a4Ed506298a/e6de9fb7b8490f38.png"
/>
</nut-avatar>
<nut-avatar><My /></nut-avatar>
<nut-avatar>
<My />
</nut-avatar>
<nut-avatar color="rgb(245, 106, 0)" bg-color="rgb(253, 227, 207)">小明</nut-avatar>
</nut-avatar-group>
</nut-cell>
Expand All @@ -67,9 +81,13 @@
src="https://img12.360buyimg.com/imagetools/jfs/t1/196430/38/8105/14329/60c806a4Ed506298a/e6de9fb7b8490f38.png"
/>
</nut-avatar>
<nut-avatar><My /></nut-avatar>
<nut-avatar>
<My />
</nut-avatar>
<nut-avatar color="rgb(245, 106, 0)" bg-color="rgb(253, 227, 207)">小明</nut-avatar>
<nut-avatar><My /></nut-avatar>
<nut-avatar>
<My />
</nut-avatar>
</nut-avatar-group>
</nut-cell>
<h2>{{ translate('title7') }}</h2>
Expand All @@ -80,21 +98,27 @@
src="https://img12.360buyimg.com/imagetools/jfs/t1/196430/38/8105/14329/60c806a4Ed506298a/e6de9fb7b8490f38.png"
/>
</nut-avatar>
<nut-avatar><My /></nut-avatar>
<nut-avatar>
<My />
</nut-avatar>
<nut-avatar color="rgb(245, 106, 0)" bg-color="rgb(253, 227, 207)">小明</nut-avatar>
<nut-avatar><My /></nut-avatar>
<nut-avatar>
<My />
</nut-avatar>
</nut-avatar-group>
</nut-cell>

<h2>{{ translate('title8') }}</h2>
<nut-cell>
<nut-avatar @click="handleClick"><My /></nut-avatar>
<nut-avatar @click="handleClick">
<My />
</nut-avatar>
</nut-cell>
</div>
</template>
<script lang="ts">
import { createComponent } from '@/packages/utils/create';
const { createDemo, translate } = createComponent('cell');
const { translate } = createComponent('cell');
import { useTranslate } from '@/sites/assets/util/useTranslate';
import { My } from '@nutui/icons-vue';
const initTranslate = () =>
Expand All @@ -120,7 +144,7 @@ const initTranslate = () =>
title8: 'Click on the avatar to trigger the event'
}
});
export default createDemo({
export default defineComponent({
components: { My },
props: {},
setup() {
Expand All @@ -136,10 +160,12 @@ export default createDemo({
.nut-cell {
align-items: flex-end;
border-radius: 0;
& > view {
margin-right: 30px;
}
}
.demo-avatar {
color: #fff;
}
Expand Down
10 changes: 6 additions & 4 deletions src/packages/__VUE/backtop/demo.vue
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@
<div class="text-data">{{ translate('content') }}24</div>
<nut-backtop @click="handleClick" el-id="elId" :distance="100" :bottom="110">
<view class="backtop-demo">
<Top width="12px" height="12px" class="nut-backtop-main"></Top
><view class="title">{{ translate('backText') }}</view>
<Top width="12px" height="12px" class="nut-backtop-main"></Top>
<view class="title">{{ translate('backText') }}</view>
</view>
</nut-backtop>
<nut-backtop @click="handleClick" el-id="elId" :distance="200" :bottom="50"></nut-backtop>
Expand All @@ -37,15 +37,15 @@

<script lang="ts">
import { createComponent } from '@/packages/utils/create';
const { createDemo, translate } = createComponent('backtop');
const { translate } = createComponent('backtop');
import { useTranslate } from '@/sites/assets/util/useTranslate';
import { Top } from '@nutui/icons-vue';
const initTranslate = () =>
useTranslate({
'zh-CN': { title: '基础用法', clg: '触发返回顶部', content: '我是测试数据', backText: '顶部' },
'en-US': { title: 'Basic Usage', clg: 'backtop', content: 'test data', backText: 'Top' }
});
export default createDemo({
export default defineComponent({
components: { Top },
setup(props, { emit }) {
initTranslate();
Expand Down Expand Up @@ -78,10 +78,12 @@ export default createDemo({
font-size: 13px;
color: rgba(102, 102, 102, 1);
}
.backtop-demo {
display: flex;
flex-direction: column;
align-items: center;
.title {
font-size: 12px;
}
Expand Down
Loading

0 comments on commit 3af2950

Please sign in to comment.