Sat Apr 29 03:31:00 UTC 2023 inscode

上级 c7b6e727
......@@ -12,20 +12,22 @@
</template>
<script>
import axios from 'axios'
import Header from '@/components/Header/Header.vue'
import Goods from '@/components/Goods/Goods.vue'
import axios from 'axios' // 导入 axios 模块
import Header from '@/components/Header/Header.vue' // 导入 Header 组件
import Goods from '@/components/Goods/Goods.vue' // 导入 Goods 组件
export default {
components: {
Header,
Goods,
Header, // 注册 Header 组件
Goods, // 注册 Goods 组件
},
data() {
return {
// 初始化 list 数据为空数组
list: []
}
},
methods: {
async initBuyCars() {
// 通过 axios 请求数据
......
......@@ -28,23 +28,24 @@
export default {
props:{
title:{
type:String,
default:'商品名称',
type:String, // 指定 title 只接受字符串类型
default:'商品名称', // 如果没有传入 title,则默认显示 '商品名称'
},
pic:{
type:String,
default:'',
type:String, // 指定 pic 只接受字符串类型
default:'', // 如果没有传入 pic,则默认为空字符串
},
chstate:{
type:Boolean,
default:true,
type:Boolean, // 指定 chstate 只接受布尔类型
default:true, // 如果没有传入 chstate,则默认为 true
},
id:{
type:Number,
required:true,
type:Number, // 指定 id 只接受数字类型
required:true, // 指定 id 是必须的,必须传递 id 属性
}
}
}
</script>
<style lang="less" scoped>
......
......@@ -6,11 +6,12 @@
export default {
props: {
title: {
type: String,
default: '标题',
type: String, // 指定 title 只接受字符串类型
default: '标题', // 如果没有传入 title,则默认显示 '标题'
},
}
}
</script>
<style lang="less" scoped>
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册