yc-ui2 0.1.0-beta1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md ADDED
@@ -0,0 +1,24 @@
1
+ # yc-ui2
2
+
3
+ ## Project setup
4
+ ```
5
+ npm install
6
+ ```
7
+
8
+ ### Compiles and hot-reloads for development
9
+ ```
10
+ npm run serve
11
+ ```
12
+
13
+ ### Compiles and minifies for production
14
+ ```
15
+ npm run build
16
+ ```
17
+
18
+ ### Lints and fixes files
19
+ ```
20
+ npm run lint
21
+ ```
22
+
23
+ ### Customize configuration
24
+ See [Configuration Reference](https://cli.vuejs.org/config/).
@@ -0,0 +1,5 @@
1
+ module.exports = {
2
+ presets: [
3
+ '@vue/cli-plugin-babel/preset'
4
+ ]
5
+ }
@@ -0,0 +1 @@
1
+ .MyButton{color:red}
Binary file
@@ -0,0 +1 @@
1
+ <!doctype html><html lang=""><head><meta charset="utf-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width,initial-scale=1"><link rel="icon" href="/favicon.ico"><title>yc-ui2</title><script defer="defer" src="/js/app.43a0c17e.js"></script><link href="/css/app.6e86a2b4.css" rel="stylesheet"></head><body><noscript><strong>We're sorry but yc-ui2 doesn't work properly without JavaScript enabled. Please enable it to continue.</strong></noscript><div id="app"></div></body></html>
@@ -0,0 +1,2 @@
1
+ (function(){"use strict";var t=function(){var t=this,e=t._self._c;return e("button",{staticClass:"MyButton"},[t._v("我是一个按钮组件")])},e=[],n={name:"MyButton",data(){return{}},methods:{},filters:{},created(){}},o=n;function r(t,e,n,o,r,s,i,a){var c,u="function"===typeof t?t.options:t;if(e&&(u.render=e,u.staticRenderFns=n,u._compiled=!0),o&&(u.functional=!0),s&&(u._scopeId="data-v-"+s),i?(c=function(t){t=t||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext,t||"undefined"===typeof __VUE_SSR_CONTEXT__||(t=__VUE_SSR_CONTEXT__),r&&r.call(this,t),t&&t._registeredComponents&&t._registeredComponents.add(i)},u._ssrRegister=c):r&&(c=a?function(){r.call(this,(u.functional?this.parent:this).$root.$options.shadowRoot)}:r),c)if(u.functional){u._injectStyles=c;var d=u.render;u.render=function(t,e){return c.call(e),d(t,e)}}else{var l=u.beforeCreate;u.beforeCreate=l?[].concat(l,c):[c]}return{exports:t,options:u}}var s=r(o,t,e,!1,null,null,null);s.exports})();
2
+ //# sourceMappingURL=app.43a0c17e.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"js/app.43a0c17e.js","mappings":"6BAAIA,EAAS,WAAkB,IAAIC,EAAIC,KAAKC,EAAGF,EAAIG,MAAMD,GAAG,OAAOA,EAAG,SAAS,CAACE,YAAY,YAAY,CAACJ,EAAIK,GAAG,aAChH,EACIC,EAAkB,GCGtB,GACAC,KAAA,WACAC,IAAAA,GACA,QACA,EACAC,QAAA,GACAC,QAAA,GACAC,OAAAA,GAAA,GCZ8P,ICM/O,SAASC,EACtBC,EACAd,EACAO,EACAQ,EACAC,EACAC,EACAC,EACAC,GAGA,IAoBIC,EApBAC,EACuB,oBAAlBP,EAA+BA,EAAcO,QAAUP,EAuDhE,GApDId,IACFqB,EAAQrB,OAASA,EACjBqB,EAAQd,gBAAkBA,EAC1Bc,EAAQC,WAAY,GAIlBP,IACFM,EAAQE,YAAa,GAInBN,IACFI,EAAQG,SAAW,UAAYP,GAI7BC,GAEFE,EAAO,SAAUK,GAEfA,EACEA,GACCvB,KAAKwB,QAAUxB,KAAKwB,OAAOC,YAC3BzB,KAAK0B,QAAU1B,KAAK0B,OAAOF,QAAUxB,KAAK0B,OAAOF,OAAOC,WAEtDF,GAA0C,qBAAxBI,sBACrBJ,EAAUI,qBAGRb,GACFA,EAAac,KAAK5B,KAAMuB,GAGtBA,GAAWA,EAAQM,uBACrBN,EAAQM,sBAAsBC,IAAId,EAEtC,EAGAG,EAAQY,aAAeb,GACdJ,IACTI,EAAOD,EACH,WACEH,EAAac,KACX5B,MACCmB,EAAQE,WAAarB,KAAK0B,OAAS1B,MAAMgC,MAAMC,SAASC,WAE7D,EACApB,GAGFI,EACF,GAAIC,EAAQE,WAAY,CAGtBF,EAAQgB,cAAgBjB,EAExB,IAAIkB,EAAiBjB,EAAQrB,OAC7BqB,EAAQrB,OAAS,SAAkCuC,EAAGd,GAEpD,OADAL,EAAKU,KAAKL,GACHa,EAAeC,EAAGd,EAC3B,CACF,KAAO,CAEL,IAAIe,EAAWnB,EAAQoB,aACvBpB,EAAQoB,aAAeD,EAAW,GAAGE,OAAOF,EAAUpB,GAAQ,CAACA,EACjE,CAGF,MAAO,CACLuB,QAAS7B,EACTO,QAASA,EAEb,CCvFA,IAAIuB,EAAY,EACd,EACA5C,EACAO,GACA,EACA,KACA,KACA,MAIaqC,EAAiB,O","sources":["webpack://yc-ui2/./src/components/Button/index.vue","webpack://yc-ui2/src/components/Button/index.vue","webpack://yc-ui2/./src/components/Button/index.vue?ab4f","webpack://yc-ui2/./node_modules/@vue/vue-loader-v15/lib/runtime/componentNormalizer.js","webpack://yc-ui2/./src/components/Button/index.vue?9a7c"],"sourcesContent":["var render = function render(){var _vm=this,_c=_vm._self._c;return _c('button',{staticClass:\"MyButton\"},[_vm._v(\"我是一个按钮组件\")])\n}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }","<template>\r\n <button class=\"MyButton\">我是一个按钮组件</button>\r\n</template>\r\n\r\n<script>\r\nexport default {\r\n name: \"MyButton\",\r\n data() {\r\n return {}\r\n },\r\n methods: {},\r\n filters: {},\r\n created() {},\r\n}\r\n</script>\r\n\r\n<style>\r\n.MyButton {\r\n color: red;\r\n}\r\n</style>\r\n","import mod from \"-!../../../node_modules/thread-loader/dist/cjs.js!../../../node_modules/babel-loader/lib/index.js??clonedRuleSet-40.use[1]!../../../node_modules/@vue/vue-loader-v15/lib/index.js??vue-loader-options!./index.vue?vue&type=script&lang=js&\"; export default mod; export * from \"-!../../../node_modules/thread-loader/dist/cjs.js!../../../node_modules/babel-loader/lib/index.js??clonedRuleSet-40.use[1]!../../../node_modules/@vue/vue-loader-v15/lib/index.js??vue-loader-options!./index.vue?vue&type=script&lang=js&\"","/* globals __VUE_SSR_CONTEXT__ */\n\n// IMPORTANT: Do NOT use ES2015 features in this file (except for modules).\n// This module is a runtime utility for cleaner component module output and will\n// be included in the final webpack user bundle.\n\nexport default function normalizeComponent(\n scriptExports,\n render,\n staticRenderFns,\n functionalTemplate,\n injectStyles,\n scopeId,\n moduleIdentifier /* server only */,\n shadowMode /* vue-cli only */\n) {\n // Vue.extend constructor export interop\n var options =\n typeof scriptExports === 'function' ? scriptExports.options : scriptExports\n\n // render functions\n if (render) {\n options.render = render\n options.staticRenderFns = staticRenderFns\n options._compiled = true\n }\n\n // functional template\n if (functionalTemplate) {\n options.functional = true\n }\n\n // scopedId\n if (scopeId) {\n options._scopeId = 'data-v-' + scopeId\n }\n\n var hook\n if (moduleIdentifier) {\n // server build\n hook = function (context) {\n // 2.3 injection\n context =\n context || // cached call\n (this.$vnode && this.$vnode.ssrContext) || // stateful\n (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional\n // 2.2 with runInNewContext: true\n if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {\n context = __VUE_SSR_CONTEXT__\n }\n // inject component styles\n if (injectStyles) {\n injectStyles.call(this, context)\n }\n // register component module identifier for async chunk inferrence\n if (context && context._registeredComponents) {\n context._registeredComponents.add(moduleIdentifier)\n }\n }\n // used by ssr in case component is cached and beforeCreate\n // never gets called\n options._ssrRegister = hook\n } else if (injectStyles) {\n hook = shadowMode\n ? function () {\n injectStyles.call(\n this,\n (options.functional ? this.parent : this).$root.$options.shadowRoot\n )\n }\n : injectStyles\n }\n\n if (hook) {\n if (options.functional) {\n // for template-only hot-reload because in that case the render fn doesn't\n // go through the normalizer\n options._injectStyles = hook\n // register for functional component in vue file\n var originalRender = options.render\n options.render = function renderWithStyleInjection(h, context) {\n hook.call(context)\n return originalRender(h, context)\n }\n } else {\n // inject component registration as beforeCreate hook\n var existing = options.beforeCreate\n options.beforeCreate = existing ? [].concat(existing, hook) : [hook]\n }\n }\n\n return {\n exports: scriptExports,\n options: options\n }\n}\n","import { render, staticRenderFns } from \"./index.vue?vue&type=template&id=3170b9bf&\"\nimport script from \"./index.vue?vue&type=script&lang=js&\"\nexport * from \"./index.vue?vue&type=script&lang=js&\"\nimport style0 from \"./index.vue?vue&type=style&index=0&id=3170b9bf&prod&lang=css&\"\n\n\n/* normalize component */\nimport normalizer from \"!../../../node_modules/@vue/vue-loader-v15/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n null,\n null,\n null\n \n)\n\nexport default component.exports"],"names":["render","_vm","this","_c","_self","staticClass","_v","staticRenderFns","name","data","methods","filters","created","normalizeComponent","scriptExports","functionalTemplate","injectStyles","scopeId","moduleIdentifier","shadowMode","hook","options","_compiled","functional","_scopeId","context","$vnode","ssrContext","parent","__VUE_SSR_CONTEXT__","call","_registeredComponents","add","_ssrRegister","$root","$options","shadowRoot","_injectStyles","originalRender","h","existing","beforeCreate","concat","exports","component"],"sourceRoot":""}
package/jsconfig.json ADDED
@@ -0,0 +1,19 @@
1
+ {
2
+ "compilerOptions": {
3
+ "target": "es5",
4
+ "module": "esnext",
5
+ "baseUrl": "./",
6
+ "moduleResolution": "node",
7
+ "paths": {
8
+ "@/*": [
9
+ "src/*"
10
+ ]
11
+ },
12
+ "lib": [
13
+ "esnext",
14
+ "dom",
15
+ "dom.iterable",
16
+ "scripthost"
17
+ ]
18
+ }
19
+ }
package/package.json ADDED
@@ -0,0 +1,46 @@
1
+ {
2
+ "name": "yc-ui2",
3
+ "version": "0.1.0-beta1",
4
+ "private": false,
5
+ "description": "测试阶段",
6
+ "main": "dist/yc-ui2.umd.min.js",
7
+ "scripts": {
8
+ "dev": "vue-cli-service serve",
9
+ "build": "vue-cli-service build",
10
+ "lint": "vue-cli-service lint",
11
+ "lib": "vue-cli-service build --targe lib src/components/index.js"
12
+ },
13
+ "dependencies": {
14
+ "core-js": "^3.8.3",
15
+ "vue": "^2.6.14"
16
+ },
17
+ "devDependencies": {
18
+ "@babel/core": "^7.12.16",
19
+ "@babel/eslint-parser": "^7.12.16",
20
+ "@vue/cli-plugin-babel": "~5.0.0",
21
+ "@vue/cli-plugin-eslint": "~5.0.0",
22
+ "@vue/cli-service": "~5.0.0",
23
+ "eslint": "^7.32.0",
24
+ "eslint-plugin-vue": "^8.0.3",
25
+ "vue-template-compiler": "^2.6.14"
26
+ },
27
+ "eslintConfig": {
28
+ "root": true,
29
+ "env": {
30
+ "node": true
31
+ },
32
+ "extends": [
33
+ "plugin:vue/essential",
34
+ "eslint:recommended"
35
+ ],
36
+ "parserOptions": {
37
+ "parser": "@babel/eslint-parser"
38
+ },
39
+ "rules": {}
40
+ },
41
+ "browserslist": [
42
+ "> 1%",
43
+ "last 2 versions",
44
+ "not dead"
45
+ ]
46
+ }
Binary file
@@ -0,0 +1,17 @@
1
+ <!DOCTYPE html>
2
+ <html lang="">
3
+ <head>
4
+ <meta charset="utf-8">
5
+ <meta http-equiv="X-UA-Compatible" content="IE=edge">
6
+ <meta name="viewport" content="width=device-width,initial-scale=1.0">
7
+ <link rel="icon" href="<%= BASE_URL %>favicon.ico">
8
+ <title><%= htmlWebpackPlugin.options.title %></title>
9
+ </head>
10
+ <body>
11
+ <noscript>
12
+ <strong>We're sorry but <%= htmlWebpackPlugin.options.title %> doesn't work properly without JavaScript enabled. Please enable it to continue.</strong>
13
+ </noscript>
14
+ <div id="app"></div>
15
+ <!-- built files will be auto injected -->
16
+ </body>
17
+ </html>
package/src/App.vue ADDED
@@ -0,0 +1,27 @@
1
+ <template>
2
+ <div id="app">
3
+ <Button></Button>
4
+ </div>
5
+ </template>
6
+
7
+ <script>
8
+ import Button from "./components/Button/index.vue"
9
+
10
+ export default {
11
+ name: "App",
12
+ components: {
13
+ Button,
14
+ },
15
+ }
16
+ </script>
17
+
18
+ <style>
19
+ #app {
20
+ font-family: Avenir, Helvetica, Arial, sans-serif;
21
+ -webkit-font-smoothing: antialiased;
22
+ -moz-osx-font-smoothing: grayscale;
23
+ text-align: center;
24
+ color: #2c3e50;
25
+ margin-top: 60px;
26
+ }
27
+ </style>
@@ -0,0 +1,21 @@
1
+ <template>
2
+ <button class="MyButton">我是一个按钮组件</button>
3
+ </template>
4
+
5
+ <script>
6
+ export default {
7
+ name: "MyButton",
8
+ data() {
9
+ return {}
10
+ },
11
+ methods: {},
12
+ filters: {},
13
+ created() {},
14
+ }
15
+ </script>
16
+
17
+ <style>
18
+ .MyButton {
19
+ color: red;
20
+ }
21
+ </style>
@@ -0,0 +1,23 @@
1
+ import ZsButton from './Button/index.vue'
2
+
3
+
4
+ const components = [
5
+ ZsButton
6
+ ]
7
+ // 定义 install 方法,接收 Vue 作为参数。如果使用 use 注册插件,则所有的组件都将被注册
8
+ const install = function (Vue) {
9
+ // 遍历注册全局组件
10
+ components.forEach(component => {
11
+ Vue.component(component.name, component)
12
+ })
13
+
14
+ // 判断是否是直接引入文件,如果是,就不用调用 Vue.use()
15
+ if (typeof window !== 'undefined' && window.Vue) {
16
+ install(window.Vue)
17
+ }
18
+ }
19
+
20
+ // 导出的对象必须具有 install,才能被 Vue.use() 方法安装
21
+ export default {
22
+ install
23
+ }
package/src/main.js ADDED
@@ -0,0 +1,8 @@
1
+ import Vue from 'vue'
2
+ import App from './App.vue'
3
+
4
+ Vue.config.productionTip = false
5
+
6
+ new Vue({
7
+ render: h => h(App),
8
+ }).$mount('#app')
package/vue.config.js ADDED
@@ -0,0 +1,4 @@
1
+ const { defineConfig } = require('@vue/cli-service')
2
+ module.exports = defineConfig({
3
+ transpileDependencies: true
4
+ })