Toggle navigation
Toggle navigation
This project
Loading...
Sign in
Hooke
/
swx_weapp
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Graphs
Network
Create a new issue
Commits
Issue Boards
You need to sign in or sign up before continuing.
Authored by
hookehuyr
2022-09-21 11:57:42 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
ebfde2d3922845f542c17e7c7493cc0e38014104
ebfde2d3
1 parent
02ac33c3
活动卡片组件传值测试
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
19 additions
and
7 deletions
src/components/activity-card.vue
src/pages/index/index.vue
src/components/activity-card.vue
View file @
ebfde2d
<!--
* @Date: 2022-09-20 15:39:37
* @LastEditors: hookehuyr hookehuyr@gmail.com
* @LastEditTime: 2022-09-21 1
0:41:18
* @LastEditTime: 2022-09-21 1
1:08:31
* @FilePath: /swx/src/components/activity-card.vue
* @Description: 活动卡片组件
-->
...
...
@@ -14,7 +14,7 @@
</van-col>
<van-col :span="14">
<view class="card-main-text">
<view style="font-size: 1.1rem;">
智慧没有烦恼
</view>
<view style="font-size: 1.1rem;">
{{ data.title }}
</view>
<view class="status-text">
<text>网络活动</text>
</view>
...
...
@@ -26,10 +26,10 @@
</van-row>
</view>
<view class="card-sub">
<van-row>
<van-row
v-if="data.address"
>
<van-col :span="24">
<view>
<van-icon :name="icon_address" size="0.95rem" />
上海市杨浦区军工路100号A座05室
<van-icon :name="icon_address" size="0.95rem" />
{{ data.address }}
</view>
</van-col>
</van-row>
...
...
@@ -52,9 +52,13 @@
</template>
<script setup>
import { ref } from 'vue'
import { ref
, defineProps
} from 'vue'
import icon_time from '@/images/icon/time@2x.png'
import icon_address from '@/images/icon/address@2x.png'
const props = defineProps({
data: Object
})
</script>
<style lang="less">
...
...
src/pages/index/index.vue
View file @
ebfde2d
<!--
* @Date: 2022-09-19 14:11:06
* @LastEditors: hookehuyr hookehuyr@gmail.com
* @LastEditTime: 2022-09-2
0 17:18:28
* @LastEditTime: 2022-09-2
1 11:02:56
* @FilePath: /swx/src/pages/index/index.vue
* @Description: 首页
-->
...
...
@@ -26,7 +26,7 @@
<text class="bg-gradient" style="font-size: 1.15rem;">推荐活动</text>
</view>
<view style="padding: 0 1rem;">
<activity-card></activity-card>
<activity-card
v-for="(item, index) in activity_list" :key="index" :data="item"
></activity-card>
</view>
</template>
...
...
@@ -35,6 +35,14 @@ import Taro from '@tarojs/taro'
import { ref } from 'vue';
import activityCard from '@/components/activity-card.vue'
const activity_list = ref([{
title: '智慧没有烦恼',
address: '上海市杨浦区军工路100号A座05室',
}, {
title: '万人共乘浪漫热气球',
address: '',
}]);
</script>
<script>
...
...
Please
register
or
login
to post a comment