{"id":9066,"date":"2023-01-19T13:43:51","date_gmt":"2023-01-19T05:43:51","guid":{"rendered":"https:\/\/sdeno.com\/?p=9066"},"modified":"2023-01-19T13:44:25","modified_gmt":"2023-01-19T05:44:25","slug":"%e5%9f%ba%e4%ba%8evue-cli%e7%9a%84uniapp%e9%a1%b9%e7%9b%ae%e4%bd%bf%e7%94%a8uni-ui%e7%bb%84%e4%bb%b6%e5%ba%93","status":"publish","type":"post","link":"https:\/\/sdeno.com\/?p=9066","title":{"rendered":"\u57fa\u4e8evue-cli\u7684uniapp\u9879\u76ee\u4f7f\u7528uni-ui\u7ec4\u4ef6\u5e93"},"content":{"rendered":"<p>uniapp vue-cli vuecli uni-ui<\/p>\n<p>\u63a8\u8350\u4f7f\u7528\u5b98\u65b9\u7ec4\u4ef7\uff0c\u5176\u4ed6\u7b2c\u4e09\u65b9\u7ec4\u4ef6\u5f15\u5165\u51fa\u73b0\u5404\u79cd\u95ee\u9898<\/p>\n<p><a href=\"https:\/\/uniapp.dcloud.net.cn\/component\/uniui\/uni-calendar.html\" target=\"_blank\" rel=\"noopener\">https:\/\/uniapp.dcloud.net.cn\/component\/uniui\/uni-calendar.html<\/a><\/p>\n<p>vueCli\u9879\u76ee\u9ed8\u8ba4\u662f\u4e0d\u7f16\u8bd1node_modules\u4e0b\u7684\u7ec4\u4ef6\u7684\uff0c\u5bfc\u81f4\u6761\u4ef6\u7f16\u8bd1\u7b49\u529f\u80fd\u5931\u6548\uff0c\u5bfc\u81f4\u7ec4\u4ef6\u5f02\u5e38\u3002<\/p>\n<p>\u9700\u8981\u6211\u4eec\u5728vue.config.js\u6587\u4ef6\u4e2d\uff0c\u6dfb\u52a0@dcloudio\/uni-ui\u5305\u7684\u7f16\u8bd1&#8221;<span style=\"background-color: #ffffff; color: #ff0000;\">transpileDependencies:[&#8216;@dcloudio\/uni-ui&#8217;]<\/span>&#8220;\u5373\u53ef\u6b63\u5e38\u3002<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">\/\/ vue.config.js\r\nmodule.exports = {\r\n  transpileDependencies:['@dcloudio\/uni-ui'],\r\n  configureWebpack: {\r\n    ...\r\n  },\r\n  chainWebpack: (config) =&gt; {\r\n    ...\r\n  },\r\n  devServer: {\r\n    ...\r\n  }\r\n}\r\n<\/pre>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>\u5b89\u88c5sass\u3001sass-loader<\/p>\n<p>uniUi\u7684\u4f7f\u7528\u5fc5\u987b\u8981\u5148\u5b89\u88c5sass\u4ee5\u53casass-loader\uff0c\u4e24\u8005\u7684\u7248\u672c\u4e0d\u63a8\u8350\u5b89\u88c5\u8f83\u9ad8\u7248\u672c\uff0c\u6709\u5bb3\u65e0\u5229\u3002<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">npm install sass@1.22.10 -D\r\nnpm install sass-loader@7.2.0 -D<\/pre>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>npm\u5b89\u88c5\u7ec4\u4ef6\u5e93<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">npm install @dcloudio\/uni-ui@1.4.24 -S<\/pre>\n<p>&nbsp;<\/p>\n<p>\u5728pages.json\u4e2d\u6dfb\u52a0easycom\u8282\u70b9<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">{\r\n    \"easycom\": {\r\n        \"autoscan\": true,\r\n        \"custom\": {\r\n            \"^uni-(.*)\": \"@dcloudio\/uni-ui\/lib\/uni-$1\/uni-$1.vue\"\r\n        }\r\n    },\r\n    \"pages\": [\r\n        ...\r\n    ],\r\n    \"globalStyle\": {\r\n        ...\r\n    }\r\n}\r\n<\/pre>\n<p>&nbsp;<\/p>\n<p>uniUi\u4e0d\u652f\u6301\u5168\u5c40Vue.use()\uff0c\u9700\u8981\u6309\u9700\u5f15\u5165\u3002<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">&lt;uni-calendar \r\n    ref=\"calendar\"\r\n    :insert=\"false\"\r\n    @confirm=\"confirm\"\r\n\/&gt;\r\n&lt;button @click=\"open\"&gt;\u6253\u5f00\u65e5\u5386&lt;\/button&gt;\r\n\r\n\r\nimport { uniCalendar } from '@dcloudio\/uni-ui';\r\n\r\nmethods: {\r\n  open(){\r\n      this.$refs.calendar.open();\r\n  },\r\n  confirm(e) {\r\n       console.log(e);\r\n  }\r\n},<\/pre>\n<p><a href=\"https:\/\/blog.csdn.net\/weixin_42216094\/article\/details\/122171394\" target=\"_blank\" rel=\"noopener\">https:\/\/blog.csdn.net\/weixin_42216094\/article\/details\/122171394<\/a><\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>uniapp vue-cli vuecli uni-ui \u63a8\u8350\u4f7f\u7528\u5b98\u65b9\u7ec4\u4ef7\uff0c\u5176\u4ed6\u7b2c\u4e09\u65b9\u7ec4\u4ef6\u5f15\u5165\u51fa\u73b0\u5404\u79cd\u95ee\u9898 h [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-9066","post","type-post","status-publish","format-standard","hentry","category-wordpress"],"_links":{"self":[{"href":"https:\/\/sdeno.com\/index.php?rest_route=\/wp\/v2\/posts\/9066","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/sdeno.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/sdeno.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/sdeno.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/sdeno.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=9066"}],"version-history":[{"count":0,"href":"https:\/\/sdeno.com\/index.php?rest_route=\/wp\/v2\/posts\/9066\/revisions"}],"wp:attachment":[{"href":"https:\/\/sdeno.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=9066"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/sdeno.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=9066"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/sdeno.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=9066"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}