uniapp引入uviews组件无效

2,067 阅读1分钟

跟着官网一步一步做,发现uniapp项目引入uviews组件没生效,找了好久原因,import 单组件引入可以使用,官网全局引入

// pages.json
{
	"easycom": {
		"^u-(.*)": "uview-ui/components/u-$1/u-$1.vue"
	},
	
	// 此为本身已有的内容
	"pages": [
		// ......
	]
}

没生效

解决方式

{
	"easycom": {
		"autoscan": true,
		"custom": {
			"^u-(.*)": "uview-ui/components/u-$1/u-$1.vue"
		} 
	},
	
	// 此为本身已有的内容
	"pages": [
		// ......
	]
}

成功解决