1
0
mirror of https://github.com/sahadev/vue-component-creater-ui.git synced 2025-06-06 13:04:05 +08:00
This commit is contained in:
shangbin 2021-04-22 16:50:02 +08:00
parent 92065271ff
commit ea5c239a91
6 changed files with 1 additions and 63 deletions

View File

@ -1,10 +0,0 @@
import Main from "./src/components-v2/Main";
// 这一步判断window.Vue是否存在因为直接引用vue.min.js 它会把Vue绑到Window上我们直接引用打包好的js才能正常跑起来。
if (typeof window !== "undefined" && window.Vue) {
window.Vue.component(Main.name, Main);
}
//这样就可以使用Vue.use进行全局安装了。
Main.install = function(Vue) {
Vue.component(Main.name, Main);
};
export default Main;

Binary file not shown.

Binary file not shown.

View File

@ -4,7 +4,7 @@ import "element-ui/lib/theme-chalk/index.css";
import AntdUI from "ant-design-vue";
import "ant-design-vue/dist/antd.css";
import APP from "./src/App.vue";
import APP from "./App.vue";
Vue.use(ElementUI);
Vue.use(AntdUI);

View File

@ -1,35 +0,0 @@
import Vue from 'vue';
import { stringify } from 'query-string';
const API = 'https://text.cinwell.xyz';
export async function upload(text) {
Vue.toasted.show('Saving...');
try {
const result = await fetch(API, {
method: 'post',
headers: {
'Content-Type': 'application/x-www-form-urlencoded; charset=UTF-8'
},
body: stringify({
text,
hash: 1
})
});
Vue.toasted.clear();
return await result.text();
} catch (e) {
Vue.toasted.clear();
Vue.toasted.show('Failed: ' + e.message, {
type: 'error',
duration: 2000
});
}
}
export function downloadURL(hash) {
return `${API}/${hash}`;
}

View File

@ -2,23 +2,6 @@ const path = require("path");
module.exports = {
css: { extract: false },
configureWebpack:
process.env.NODE_ENV === "production"
? {
entry: "./index.js",
output: {
filename: "build.js",
library: "vcc",
libraryTarget: "umd",
umdNamedDefine: true,
},
}
: {
entry: "./main.js"
},
lintOnSave: true,
chainWebpack: (config) => {
const vueRule = config.module.rule("vue");