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:
Binary file not shown.
Binary file not shown.
16
src/main.js
Normal file
16
src/main.js
Normal 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),
|
||||
});
|
||||
|
@@ -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}`;
|
||||
}
|
Reference in New Issue
Block a user