资源优化
This commit is contained in:
@@ -14,12 +14,17 @@ const props = defineProps({
|
|||||||
type: Array,
|
type: Array,
|
||||||
default: () => [],
|
default: () => [],
|
||||||
},
|
},
|
||||||
|
onChange: {
|
||||||
|
type: Function,
|
||||||
|
default: (index) => {},
|
||||||
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
const currentIndex = ref(0);
|
const currentIndex = ref(0);
|
||||||
|
|
||||||
const handleChange = (e) => {
|
const handleChange = (e) => {
|
||||||
currentIndex.value = e.detail.current;
|
currentIndex.value = e.detail.current;
|
||||||
|
props.onChange(e.detail.current);
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
@@ -81,10 +86,10 @@ const handleChange = (e) => {
|
|||||||
width: 8px;
|
width: 8px;
|
||||||
height: 8px;
|
height: 8px;
|
||||||
border-radius: 50%;
|
border-radius: 50%;
|
||||||
background-color: rgba(255, 255, 255, 0.5);
|
background-color: #ccc;
|
||||||
}
|
}
|
||||||
|
|
||||||
.dot.active {
|
.dot.active {
|
||||||
background-color: #fff;
|
background-color: #000;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@@ -77,7 +77,10 @@ const onCreateRoom = async () => {
|
|||||||
<view class="create-room">
|
<view class="create-room">
|
||||||
<image src="../static/battle-bg.png" mode="widthFix" />
|
<image src="../static/battle-bg.png" mode="widthFix" />
|
||||||
<view>
|
<view>
|
||||||
<image src="../static/avatar.png" mode="widthFix" />
|
<image
|
||||||
|
src="https://api.shelingxingqiu.com/attachment/2025-07-12/db9x4i9g536xerkv9i.png"
|
||||||
|
mode="widthFix"
|
||||||
|
/>
|
||||||
<image src="../static/versus.png" mode="widthFix" />
|
<image src="../static/versus.png" mode="widthFix" />
|
||||||
<view>
|
<view>
|
||||||
<image src="../static/question-mark.png" mode="widthFix" />
|
<image src="../static/question-mark.png" mode="widthFix" />
|
||||||
|
|||||||
@@ -34,7 +34,7 @@ const toPractiseTwo = () => {
|
|||||||
/>
|
/>
|
||||||
<view class="practise-btn" @click="toPractiseOne">
|
<view class="practise-btn" @click="toPractiseOne">
|
||||||
<image
|
<image
|
||||||
src="../static/practise1.png"
|
src="https://api.shelingxingqiu.com/attachment/2025-07-12/db9x668e2vdtqh0otq.png"
|
||||||
class="practise1"
|
class="practise1"
|
||||||
mode="widthFix"
|
mode="widthFix"
|
||||||
/>
|
/>
|
||||||
@@ -46,7 +46,7 @@ const toPractiseTwo = () => {
|
|||||||
/>
|
/>
|
||||||
<view class="practise-btn" @click="toPractiseTwo">
|
<view class="practise-btn" @click="toPractiseTwo">
|
||||||
<image
|
<image
|
||||||
src="../static/practise2.png"
|
src="https://api.shelingxingqiu.com/attachment/2025-07-12/db9x668eehkvyicc08.png"
|
||||||
class="practise2"
|
class="practise2"
|
||||||
mode="widthFix"
|
mode="widthFix"
|
||||||
/>
|
/>
|
||||||
|
|||||||
Binary file not shown.
|
Before Width: | Height: | Size: 5.2 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 50 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 50 KiB |
Reference in New Issue
Block a user