Skip to content

Commit

Permalink
feat: taro h5 demo
Browse files Browse the repository at this point in the history
  • Loading branch information
szg2008 committed Jan 13, 2023
1 parent 90649b8 commit a2404f9
Show file tree
Hide file tree
Showing 14 changed files with 50 additions and 51 deletions.
3 changes: 0 additions & 3 deletions src/sites/mobile-taro/vue/src/basic/pages/popup/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,6 @@
<h2>圆角弹框</h2>
<nut-cell title="圆角弹框" is-link @click="showRound = true"></nut-cell>
<nut-popup position="bottom" closeable round :style="{ height: '30%' }" v-model:visible="showRound"></nut-popup>
<h2>指定挂载节点</h2>
<nut-cell title="指定挂载节点" is-link @click="showTeleport = true"></nut-cell>
<nut-popup :style="{ padding: '30px 50px' }" teleport="#app" v-model:visible="showTeleport">app</nut-popup>
<h2>多层堆叠</h2>
<nut-cell title="多层堆叠" is-link @click="showPop1 = true"></nut-cell>
<nut-popup :style="{ padding: '30px 50px' }" v-model:visible="showPop1">
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<template>
<div class="demo" :class="{ web: env === 'WEB' }">
<div class="demo addresslist-demo" :class="{ web: env === 'WEB' }">
<Header v-if="env === 'WEB'" />
<h2>基础用法</h2>
<nut-address-list
Expand Down Expand Up @@ -113,7 +113,7 @@ export default {
</script>

<style lang="scss" scoped>
.demo {
.addresslist-demo {
padding-right: 0 !important;
padding-left: 0 !important;
}
Expand Down
18 changes: 10 additions & 8 deletions src/sites/mobile-taro/vue/src/business/pages/barrage/index.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<template>
<div class="demo" :class="{ web: env === 'WEB' }">
<div class="demo barrage-demo" :class="{ web: env === 'WEB' }">
<Header v-if="env === 'WEB'" />
<h2>基础用法</h2>
<nut-cell class="danmu-box">
Expand Down Expand Up @@ -38,12 +38,14 @@ export default {
</script>

<style lang="scss">
.danmu-box,
.nut-barrage {
padding: 20px 0;
height: 150px;
}
.nut-button {
width: 100%;
.barrage-demo {
.danmu-box,
.nut-barrage {
padding: 20px 0;
height: 150px;
}
.nut-button {
width: 100%;
}
}
</style>
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<template>
<div class="demo full" :class="{ web: env === 'WEB' }">
<div class="demo full category-demo" :class="{ web: env === 'WEB' }">
<Header v-if="env === 'WEB'" />
<h2>经典分类模式</h2>
<nut-category :category="category" @change="change">
Expand Down Expand Up @@ -73,7 +73,7 @@ export default {
</script>

<style lang="scss" scoped>
.demo {
.category-demo {
padding-left: 0 !important;
padding-right: 0px !important;
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<template>
<div class="demo" :class="{ web: env === 'WEB' }">
<div class="demo signature-demo" :class="{ web: env === 'WEB' }">
<Header v-if="env === 'WEB'" />
<h2>基础用法</h2>
<nut-signature @confirm="confirm" @clear="clear" custom-class="test" @start="start"></nut-signature>
Expand Down Expand Up @@ -73,7 +73,7 @@ export default {
</script>

<style lang="scss">
#app .demo {
#app .signature-demo {
height: auto;
}
.test {
Expand Down
10 changes: 4 additions & 6 deletions src/sites/mobile-taro/vue/src/components/header.vue
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<template>
<div class="applets-demo-header">
<div class="back" @click="navigateTo">
<Home />
<Left />
</div>
<div class="applets-icon">
<img
Expand All @@ -14,19 +14,17 @@
<script lang="ts">
import { defineComponent, computed } from 'vue';
import Taro from '@tarojs/taro';
import { Home } from '@nutui/icons-vue';
import { Left } from '@nutui/icons-vue-taro';
import config from '../../../../../config.json';
export default defineComponent({
name: 'header',
components: {
Home
Left
},
setup() {
//返回demo页
const navigateTo = () => {
Taro.navigateTo({
url: '/pages/index/index'
});
Taro.navigateBack();
};
const compName = computed(() => {
Expand Down
8 changes: 5 additions & 3 deletions src/sites/mobile-taro/vue/src/dentry/pages/range/index.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<template>
<div class="demo" :class="{ web: env === 'WEB' }">
<div class="demo range-demo" :class="{ web: env === 'WEB' }">
<Header v-if="env === 'WEB'" />
<h2>基础用法</h2>
<nut-cell class="cell">
Expand Down Expand Up @@ -130,8 +130,10 @@ export default {
</script>

<style lang="scss">
.cell {
padding: 40px 18px;
.range-demo {
.cell {
padding: 40px 18px;
}
}
.custom-button {
width: 26px;
Expand Down
20 changes: 11 additions & 9 deletions src/sites/mobile-taro/vue/src/exhibition/pages/avatar/index.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<template>
<div class="demo full" :class="{ web: env === 'WEB' }">
<div class="demo full avatar-demo" :class="{ web: env === 'WEB' }">
<Header v-if="env === 'WEB'" />
<h2>支持三种尺寸:small、normal、large</h2>
<nut-cell>
Expand Down Expand Up @@ -111,14 +111,16 @@ export default {
};
</script>
<style lang="scss">
.nut-cell {
align-items: flex-end;
border-radius: 0;
& > view {
margin-right: 30px;
.avatar-demo {
.nut-cell {
align-items: flex-end;
border-radius: 0;
& > view {
margin-right: 30px;
}
}
.demo-avatar {
color: #fff;
}
}
.demo-avatar {
color: #fff;
}
</style>
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<template>
<div class="demo" :class="{ web: env === 'WEB' }">
<div class="demo countup-demo" :class="{ web: env === 'WEB' }">
<Header v-if="env === 'WEB'" />
<h2>基础用法</h2>
<div class="show-demo">
Expand Down Expand Up @@ -109,7 +109,7 @@ export default {

<style></style>
<style lang="scss">
#app .demo {
#app .countup-demo {
padding: 57px 0 0 0;
}
.show-demo {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ export default {
};
</script>

<style lang="scss" scoped>
<style lang="scss">
.demo {
padding-bottom: 30px !important;
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<template>
<div class="demo" :class="{ web: env === 'WEB' }">
<div class="demo actionsheet" :class="{ web: env === 'WEB' }">
<Header v-if="env === 'WEB'" />
<h2>基础用法</h2>
<nut-cell :show-icon="true" :isLink="true" @click="switchActionSheet('isVisible1')">
Expand Down Expand Up @@ -177,8 +177,10 @@ export default {
padding: 110px 0;
text-align: center;
}
.nut-cell {
justify-content: space-between;
.actionsheet {
.nut-cell {
justify-content: space-between;
}
}
.custom-content {
padding: 10px 10px 160px;
Expand Down
4 changes: 2 additions & 2 deletions src/sites/mobile-taro/vue/src/layout/pages/layout/index.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<template>
<div class="demo full" :class="{ web: env === 'WEB' }">
<div class="demo full layout-demo" :class="{ web: env === 'WEB' }">
<Header v-if="env === 'WEB'" />
<h2>基础布局</h2>
<div class="box-item">
Expand Down Expand Up @@ -141,7 +141,7 @@ export default {
margin-bottom: 20px;
padding: 20px 0;
}
.demo .nut-row {
.layout-demo .nut-row {
overflow: hidden;
&:not(:last-child) .nut-col {
margin-bottom: 15px;
Expand Down
8 changes: 4 additions & 4 deletions src/sites/mobile-taro/vue/src/nav/pages/navbar/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -84,17 +84,17 @@ export default defineComponent({
const tab2value = ref(0);
const methods = {
back() {
alert('header头部, 点击返回');
console.log('header头部, 点击返回');
},
title() {
alert('header头部, 点击title');
console.log('header头部, 点击title');
},
icon() {
alert('icon');
console.log('icon');
},
rightClick() {
alert('右侧点击事件');
console.log('右侧点击事件');
},
changeTab(tab: any) {
tab1value.value = tab.paneKey as number;
Expand Down
4 changes: 0 additions & 4 deletions src/sites/mobile-taro/vue/src/pages/index/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -67,10 +67,6 @@ export default {
Taro.navigateTo({
url: `/${enName}/pages/${name.toLowerCase()}/index`
});
if (Taro.getEnv() === 'WEB' && parent.location.href.includes('zh-CN')) {
parent.location.href = `${parent.location.origin}/vue_taro/index.html#/zh-CN/component/${name.toLowerCase()}`;
}
};
return {
Expand Down

0 comments on commit a2404f9

Please sign in to comment.