解决uniapp警告:
Extraneous non-props attributes (xxx) were passed to component but could not be automatically inherited because component renders fragment or text root nodes.
问题描述
在路由跳转到某个页面时,传递参数会出现该警告
js
uni.navigateTo({
url: `/pages/search/search?id=${1}`,
});
// Extraneous non-props attributes (id) were passed to ...
解决办法
确保对应页面的template部分只有一个根节点就能解决
Search.vue
<template>
<view>
页面内容
</view>
</template>