@timus-networks/theme 1.0.40 → 1.0.41
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.
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="pt-8 pb-16 flex gap-12 flex-col">
|
|
3
|
+
<section>
|
|
4
|
+
<h1>Basic</h1>
|
|
5
|
+
<p class="p-lg my-6">
|
|
6
|
+
Use the type attribute to define Tag's type. In addition, the color attribute can be used to set the background color of the Tag.
|
|
7
|
+
</p>
|
|
8
|
+
<div class="grid grid-flow-col auto-cols-max gap-4">
|
|
9
|
+
<el-upload
|
|
10
|
+
class="el-upload-container"
|
|
11
|
+
drag
|
|
12
|
+
action="https://jsonplaceholder.typicode.com/posts/"
|
|
13
|
+
:on-preview="handlePreview"
|
|
14
|
+
:on-remove="handleRemove"
|
|
15
|
+
:file-list="fileList"
|
|
16
|
+
multiple
|
|
17
|
+
>
|
|
18
|
+
<i class="el-icon-upload"></i>
|
|
19
|
+
<div class="el-upload__text">
|
|
20
|
+
<span class="title">Drop file here or</span>
|
|
21
|
+
<span class="description">click to upload</span>
|
|
22
|
+
</div>
|
|
23
|
+
<div class="el-upload__tip" slot="tip">jpg/png files with a size less than 500kb</div>
|
|
24
|
+
</el-upload>
|
|
25
|
+
</div>
|
|
26
|
+
<div class="my-4 p-4 border-l-4 border-blue-600 bg-blue-100">
|
|
27
|
+
<p class="text-xs">
|
|
28
|
+
<code><el-input placeholder="Please input" v-model="input"></el-input></code>
|
|
29
|
+
</p>
|
|
30
|
+
</div>
|
|
31
|
+
</section>
|
|
32
|
+
</div>
|
|
33
|
+
</template>
|
|
34
|
+
<script>
|
|
35
|
+
import Vue from 'vue';
|
|
36
|
+
|
|
37
|
+
export default Vue.extend({
|
|
38
|
+
name: 'TimusUpload',
|
|
39
|
+
data() {
|
|
40
|
+
return {
|
|
41
|
+
imageUrl: '',
|
|
42
|
+
};
|
|
43
|
+
},
|
|
44
|
+
methods: {
|
|
45
|
+
handleAvatarSuccess(res, file) {
|
|
46
|
+
this.imageUrl = URL.createObjectURL(file.raw);
|
|
47
|
+
},
|
|
48
|
+
beforeAvatarUpload(file) {
|
|
49
|
+
const isJPG = file.type === 'image/jpeg';
|
|
50
|
+
const isLt2M = file.size / 1024 / 1024 < 2;
|
|
51
|
+
|
|
52
|
+
if (!isJPG) {
|
|
53
|
+
this.$message.error('Avatar picture must be JPG format!');
|
|
54
|
+
}
|
|
55
|
+
if (!isLt2M) {
|
|
56
|
+
this.$message.error('Avatar picture size can not exceed 2MB!');
|
|
57
|
+
}
|
|
58
|
+
return isJPG && isLt2M;
|
|
59
|
+
},
|
|
60
|
+
},
|
|
61
|
+
});
|
|
62
|
+
</script>
|
|
@@ -22,6 +22,7 @@
|
|
|
22
22
|
<el-tab-pane label="Logo" name="nineteen"><ThemeLogo></ThemeLogo></el-tab-pane>
|
|
23
23
|
<el-tab-pane label="Dialog" name="twenty"><ThemeDialog></ThemeDialog></el-tab-pane>
|
|
24
24
|
<el-tab-pane label="Sidebar" name="twenty-one"><ThemeSidebar></ThemeSidebar></el-tab-pane>
|
|
25
|
+
<el-tab-pane label="Upload" name="twenty-two"><ThemeUpload></ThemeUpload></el-tab-pane>
|
|
25
26
|
</el-tabs>
|
|
26
27
|
</div>
|
|
27
28
|
</template>
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="pt-8 pb-16 flex gap-12 flex-col">
|
|
3
|
+
<section>
|
|
4
|
+
<h1>Basic</h1>
|
|
5
|
+
<p class="p-lg my-6">
|
|
6
|
+
Use the type attribute to define Tag's type. In addition, the color attribute can be used to set the background color of the Tag.
|
|
7
|
+
</p>
|
|
8
|
+
<div class="grid grid-flow-col auto-cols-max gap-4">
|
|
9
|
+
<el-upload
|
|
10
|
+
class="el-upload-container"
|
|
11
|
+
drag
|
|
12
|
+
action="https://jsonplaceholder.typicode.com/posts/"
|
|
13
|
+
:on-preview="handlePreview"
|
|
14
|
+
:on-remove="handleRemove"
|
|
15
|
+
:file-list="fileList"
|
|
16
|
+
multiple
|
|
17
|
+
>
|
|
18
|
+
<i class="el-icon-upload"></i>
|
|
19
|
+
<div class="el-upload__text">
|
|
20
|
+
<span class="title">Drop file here or</span>
|
|
21
|
+
<span class="description">click to upload</span>
|
|
22
|
+
</div>
|
|
23
|
+
<div class="el-upload__tip" slot="tip">jpg/png files with a size less than 500kb</div>
|
|
24
|
+
</el-upload>
|
|
25
|
+
</div>
|
|
26
|
+
<div class="my-4 p-4 border-l-4 border-blue-600 bg-blue-100">
|
|
27
|
+
<p class="text-xs">
|
|
28
|
+
<code><el-input placeholder="Please input" v-model="input"></el-input></code>
|
|
29
|
+
</p>
|
|
30
|
+
</div>
|
|
31
|
+
</section>
|
|
32
|
+
</div>
|
|
33
|
+
</template>
|
|
34
|
+
<script>
|
|
35
|
+
import Vue from 'vue';
|
|
36
|
+
|
|
37
|
+
export default Vue.extend({
|
|
38
|
+
name: 'TimusUpload',
|
|
39
|
+
data() {
|
|
40
|
+
return {
|
|
41
|
+
imageUrl: '',
|
|
42
|
+
};
|
|
43
|
+
},
|
|
44
|
+
methods: {
|
|
45
|
+
handleAvatarSuccess(res, file) {
|
|
46
|
+
this.imageUrl = URL.createObjectURL(file.raw);
|
|
47
|
+
},
|
|
48
|
+
beforeAvatarUpload(file) {
|
|
49
|
+
const isJPG = file.type === 'image/jpeg';
|
|
50
|
+
const isLt2M = file.size / 1024 / 1024 < 2;
|
|
51
|
+
|
|
52
|
+
if (!isJPG) {
|
|
53
|
+
this.$message.error('Avatar picture must be JPG format!');
|
|
54
|
+
}
|
|
55
|
+
if (!isLt2M) {
|
|
56
|
+
this.$message.error('Avatar picture size can not exceed 2MB!');
|
|
57
|
+
}
|
|
58
|
+
return isJPG && isLt2M;
|
|
59
|
+
},
|
|
60
|
+
},
|
|
61
|
+
});
|
|
62
|
+
</script>
|
|
@@ -22,6 +22,7 @@
|
|
|
22
22
|
<el-tab-pane label="Logo" name="nineteen"><ThemeLogo></ThemeLogo></el-tab-pane>
|
|
23
23
|
<el-tab-pane label="Dialog" name="twenty"><ThemeDialog></ThemeDialog></el-tab-pane>
|
|
24
24
|
<el-tab-pane label="Sidebar" name="twenty-one"><ThemeSidebar></ThemeSidebar></el-tab-pane>
|
|
25
|
+
<el-tab-pane label="Upload" name="twenty-two"><ThemeUpload></ThemeUpload></el-tab-pane>
|
|
25
26
|
</el-tabs>
|
|
26
27
|
</div>
|
|
27
28
|
</template>
|