This commit is contained in:
zhcnyuyang 2025-06-10 19:54:06 +08:00
parent e8c0fa869e
commit b34af3da0b

View File

@ -53,10 +53,13 @@ export default defineComponent({
this.isLoading = false; this.isLoading = false;
}); });
}, },
isActiveRoute(routename) { isActiveRoute:function(routename) {
// Example: Apply style if route name starts with 'user-' // Example: Apply style if route name starts with 'user-'
console.log('Current route name:', this.$route.name, 'Comparing with:', routename); console.log('Current route name:', this.$route.name, 'Comparing with:', routename);
return this.$route.name === routename; return this.$route.name === routename;
},
toExamples:function(){
window.location.href='/Examples';
} }
}, },
mounted() { mounted() {
@ -84,6 +87,15 @@ export default defineComponent({
</tbody> </tbody>
</table> </table>
</span> </span>
<span class="normalcontenttext" style="width: 100%;"
v-if="isActiveRoute('/Examples')">
</span>
<span class="normalcontenttext" style="width: 100%;" v-else>
<button type="button" class="btn btn-primary"
@click="toExamples" style="width: 100%;">
查看更多
</button>
</span>
</div> </div>
</div> </div>
</template> </template>