Nuxt 是基于 nodejs + vue 写的,服务器端渲染 框架(SSR)
页面组件代码结构:
<template>
模板内容(html内容,注意:必须有一个根元素)
</template>
<script>
// 组件的JS部分
export default {
}
</script>
<style>
组件的CSS部分
</style>
两种参数与文件名总结
URL | 对应页面 | 接收方式 |
---|---|---|
/goods/:id | pages/goods/_id.vue | this.$route.params.id |
/goods?id=x | pages/goods.vue | this.$route.query.id |
/order/:catid/:userid/?limit=10 | pages/order/_catid/_userid.vue | 使用 this.$route 中的 params 和 query 来分别接收两种参数。 |
扫码关注腾讯云开发者
领取腾讯云代金券
Copyright © 2013 - 2025 Tencent Cloud. All Rights Reserved. 腾讯云 版权所有
深圳市腾讯计算机系统有限公司 ICP备案/许可证号:粤B2-20090059 深公网安备号 44030502008569
腾讯云计算(北京)有限责任公司 京ICP证150476号 | 京ICP备11018762号 | 京公网安备号11010802020287
Copyright © 2013 - 2025 Tencent Cloud.
All Rights Reserved. 腾讯云 版权所有