Sat Apr 29 03:31:00 UTC 2023 inscode

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