1
0
mirror of https://github.com/sahadev/vue-component-creater-ui.git synced 2025-09-28 07:13:21 +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

Binary file not shown.

Binary file not shown.

16
src/main.js Normal file
View File

@@ -0,0 +1,16 @@
import Vue from "vue";
import ElementUI from "element-ui";
import "element-ui/lib/theme-chalk/index.css";
import AntdUI from "ant-design-vue";
import "ant-design-vue/dist/antd.css";
import APP from "./App.vue";
Vue.use(ElementUI);
Vue.use(AntdUI);
new Vue({
el: "#app",
render: (h) => h(APP),
});

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}`;
}