trtc-cloud-js-sdk 1.0.13 → 2.0.0
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/.eslintrc.js +88 -0
- package/.prettierrc +5 -0
- package/CHANGELOG.md +58 -0
- package/build/jsdoc/clean-doc.js +12 -0
- package/build/jsdoc/fix-doc.js +141 -0
- package/build/jsdoc/jsdoc.json +42 -0
- package/build/package-bundle.js +29 -0
- package/build/rollup.config.dev.js +88 -0
- package/build/rollup.config.prod.js +93 -0
- package/build/rollup.js +359 -0
- package/build/template/npm-package/package.json +24 -0
- package/coverage/Chrome 103.0.5060 (Mac OS X 10.15.7)/base.css +213 -0
- package/coverage/Chrome 103.0.5060 (Mac OS X 10.15.7)/index.html +80 -0
- package/coverage/Chrome 103.0.5060 (Mac OS X 10.15.7)/prettify.css +1 -0
- package/coverage/Chrome 103.0.5060 (Mac OS X 10.15.7)/prettify.js +1 -0
- package/coverage/Chrome 103.0.5060 (Mac OS X 10.15.7)/sort-arrow-sprite.png +0 -0
- package/coverage/Chrome 103.0.5060 (Mac OS X 10.15.7)/sorter.js +158 -0
- package/examples/apiExample/.env +2 -0
- package/examples/apiExample/README.md +70 -0
- package/examples/apiExample/package-lock.json +30915 -0
- package/examples/apiExample/package.json +51 -0
- package/examples/apiExample/public/audio.js +195 -0
- package/examples/apiExample/public/audio.js.map +7 -0
- package/examples/apiExample/public/av_processing.js +1 -0
- package/examples/apiExample/public/basic/av_processing.wasm +0 -0
- package/examples/apiExample/public/basic/worker.js +10434 -0
- package/examples/apiExample/public/favicon.ico +0 -0
- package/examples/apiExample/public/index.html +47 -0
- package/examples/apiExample/public/logo192.png +0 -0
- package/examples/apiExample/public/logo512.png +0 -0
- package/examples/apiExample/public/manifest.json +25 -0
- package/examples/apiExample/public/robots.txt +3 -0
- package/examples/apiExample/src/App.css +37 -0
- package/examples/apiExample/src/App.js +25 -0
- package/examples/apiExample/src/api/http.js +127 -0
- package/examples/apiExample/src/api/nav.js +44 -0
- package/examples/apiExample/src/components/BasicInfoComponent.css +16 -0
- package/examples/apiExample/src/components/BasicInfoComponent.js +27 -0
- package/examples/apiExample/src/config/gen-test-user-sig.js +64 -0
- package/examples/apiExample/src/config/lib-generate-test-usersig.min.js +7052 -0
- package/examples/apiExample/src/config/nav.js +136 -0
- package/examples/apiExample/src/home.js +16 -0
- package/examples/apiExample/src/index.css +21 -0
- package/examples/apiExample/src/index.js +12 -0
- package/examples/apiExample/src/logo.svg +1 -0
- package/examples/apiExample/src/page/basic/screen-share/index.css +52 -0
- package/examples/apiExample/src/page/basic/screen-share/index.js +223 -0
- package/examples/apiExample/src/page/basic/setDevice/index.js +262 -0
- package/examples/apiExample/src/page/basic/setDevice/index.scss +93 -0
- package/examples/apiExample/src/page/basic/video-call/index.js +521 -0
- package/examples/apiExample/src/page/basic/video-call/index.scss +93 -0
- package/examples/apiExample/src/page/basic/video-call-init/index.js +382 -0
- package/examples/apiExample/src/page/basic/video-call-init/index.scss +93 -0
- package/examples/apiExample/src/page/basic/video-live/index.css +37 -0
- package/examples/apiExample/src/page/basic/video-live/index.js +188 -0
- package/examples/apiExample/src/page/layout.js +22 -0
- package/examples/apiExample/src/page/layout.scss +76 -0
- package/examples/apiExample/src/utils/utils.js +35 -0
- package/examples/jsExample/assets/css/bootstrap-material-design.css +12169 -0
- package/examples/jsExample/assets/css/bootstrap-material-design.min.css +8 -0
- package/examples/jsExample/assets/css/common.css +48 -0
- package/examples/jsExample/assets/icon/iconfont.js +1 -0
- package/examples/jsExample/assets/js/bootstrap-material-design.js +6939 -0
- package/examples/jsExample/assets/js/bootstrap-material-design.js.map +1 -0
- package/examples/jsExample/assets/js/bootstrap-material-design.min.js +1 -0
- package/examples/jsExample/assets/js/graph.js +695 -0
- package/examples/jsExample/assets/js/jquery-3.2.1.min.js +4 -0
- package/examples/jsExample/assets/js/jquery-3.2.1.slim.min.js +4 -0
- package/examples/jsExample/assets/js/lib-generate-test-usersig.min.js +2 -0
- package/examples/jsExample/assets/js/popper.js +2442 -0
- package/examples/jsExample/index.html +57 -0
- package/examples/jsExample/rtc/css/common.css +82 -0
- package/examples/jsExample/rtc/index.html +107 -0
- package/examples/jsExample/rtc/js/index.js +142 -0
- package/examples/vueDemo/LICENSE +21 -0
- package/examples/vueDemo/README.md +144 -0
- package/examples/vueDemo/README_EN.md +136 -0
- package/examples/vueDemo/av_processing.wasm +0 -0
- package/examples/vueDemo/index.html +23 -0
- package/examples/vueDemo/package-lock.json +1375 -0
- package/examples/vueDemo/package.json +36 -0
- package/examples/vueDemo/src/App.vue +12 -0
- package/examples/vueDemo/src/api/index.js +59 -0
- package/examples/vueDemo/src/assets/css/color-dark.css +28 -0
- package/examples/vueDemo/src/assets/css/icon.css +4 -0
- package/examples/vueDemo/src/assets/css/main.css +177 -0
- package/examples/vueDemo/src/assets/img/img.jpg +0 -0
- package/examples/vueDemo/src/assets/img/login-bg.jpg +0 -0
- package/examples/vueDemo/src/components/Header.vue +172 -0
- package/examples/vueDemo/src/components/Sidebar.vue +117 -0
- package/examples/vueDemo/src/components/Tags.vue +174 -0
- package/examples/vueDemo/src/components/tendency.vue +206 -0
- package/examples/vueDemo/src/components/trtc/main-menu.vue +50 -0
- package/examples/vueDemo/src/components/trtc/nav-bar.vue +53 -0
- package/examples/vueDemo/src/components/trtc/show-screen-capture.vue +118 -0
- package/examples/vueDemo/src/components/trtc/trtc-state-check.vue +117 -0
- package/examples/vueDemo/src/config/gen-test-user-sig.js +67 -0
- package/examples/vueDemo/src/config/lib-generate-test-usersig.min.js +7052 -0
- package/examples/vueDemo/src/main.js +11 -0
- package/examples/vueDemo/src/plugins/element.js +17 -0
- package/examples/vueDemo/src/router/index.js +73 -0
- package/examples/vueDemo/src/store/sidebar.js +17 -0
- package/examples/vueDemo/src/store/tags.js +48 -0
- package/examples/vueDemo/src/utils/i18n.js +24 -0
- package/examples/vueDemo/src/utils/request.js +34 -0
- package/examples/vueDemo/src/utils/utils.js +35 -0
- package/examples/vueDemo/src/views/Home.vue +46 -0
- package/examples/vueDemo/src/views/I18n.vue +40 -0
- package/examples/vueDemo/src/views/Icon.vue +229 -0
- package/examples/vueDemo/src/views/basic/trtc.vue +194 -0
- package/examples/vueDemo/src/views/feature/index.vue +259 -0
- package/examples/vueDemo/src/views/github/index.vue +243 -0
- package/examples/vueDemo/src/views/improve/live-index.vue +256 -0
- package/examples/vueDemo/src/views/improve/live-room-anchor.vue +689 -0
- package/examples/vueDemo/src/views/improve/live-room-audience.vue +383 -0
- package/examples/vueDemo/src/views/sdkAppId/index.vue +284 -0
- package/examples/vueDemo/vite.config.js +18 -0
- package/examples/vueDemo/worker.js +22 -0
- package/karma.conf.js +99 -0
- package/package.json +57 -7
- package/scripts/publish.js +86 -0
- package/src/Camera.ts +80 -0
- package/src/Mic.ts +145 -0
- package/src/common/IError.ts +6 -0
- package/src/common/ITRTCCloud.ts +68 -0
- package/src/common/constants.ts +116 -0
- package/src/common/trtc-code.ts +43 -0
- package/src/common/trtc-define.ts +1007 -0
- package/src/common/trtc-event.ts +29 -0
- package/src/index.ts +1672 -0
- package/src/utils/environment.js +297 -0
- package/src/utils/raf.js +131 -0
- package/src/utils/time.js +22 -0
- package/src/utils/utils.ts +71 -0
- package/src/utils/uuid.js +12 -0
- package/test/unit/env.test.js +25 -0
- package/test/unit/get-user-media.test.js +40 -0
- package/test/unit/ice-parser.test.js +23 -0
- package/test/unit/sdp.test.js +45 -0
- package/test/unit/signal.test.js +78 -0
- package/tsconfig.json +32 -0
- package/trtc-cloud-js-sdk.js +0 -1
- /package/{README.md → build/template/npm-package/README.md} +0 -0
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import {createApp} from 'vue'
|
|
2
|
+
import { createPinia } from 'pinia'
|
|
3
|
+
import App from './App.vue'
|
|
4
|
+
import router from './router'
|
|
5
|
+
import installElementPlus from './plugins/element'
|
|
6
|
+
import './assets/css/icon.css'
|
|
7
|
+
const app = createApp(App)
|
|
8
|
+
installElementPlus(app)
|
|
9
|
+
app.use(createPinia())
|
|
10
|
+
.use(router)
|
|
11
|
+
.mount('#app')
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import ElementPlus from 'element-plus'
|
|
2
|
+
import { createI18n } from 'vue-i18n'
|
|
3
|
+
import 'element-plus/lib/theme-chalk/index.css'
|
|
4
|
+
import localeZH from 'element-plus/lib/locale/lang/zh-cn'
|
|
5
|
+
import localeEN from 'element-plus/lib/locale/lang/en'
|
|
6
|
+
import messages from '../utils/i18n'
|
|
7
|
+
|
|
8
|
+
const i18n = createI18n({
|
|
9
|
+
locale: localeZH.name,
|
|
10
|
+
fallbackLocale: localeEN.name,
|
|
11
|
+
messages,
|
|
12
|
+
})
|
|
13
|
+
|
|
14
|
+
export default (app) => {
|
|
15
|
+
app.use(ElementPlus, { locale:localeZH })
|
|
16
|
+
app.use(i18n)
|
|
17
|
+
}
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import { createRouter, createWebHashHistory } from 'vue-router';
|
|
2
|
+
import Home from '../views/Home.vue';
|
|
3
|
+
|
|
4
|
+
const routes = [
|
|
5
|
+
{
|
|
6
|
+
path: '/',
|
|
7
|
+
// redirect: '/basic/trtc',
|
|
8
|
+
redirect: '/github',
|
|
9
|
+
},
|
|
10
|
+
{
|
|
11
|
+
path: '/',
|
|
12
|
+
name: 'Home',
|
|
13
|
+
component: Home,
|
|
14
|
+
// 【数据统计】
|
|
15
|
+
children: [
|
|
16
|
+
{
|
|
17
|
+
path: '/basic/trtc',
|
|
18
|
+
name: '基本音视频',
|
|
19
|
+
meta: {
|
|
20
|
+
title: '基本音视频',
|
|
21
|
+
},
|
|
22
|
+
component: () => import(/* webpackChunkName: "dashboard" */ '../views/basic/trtc.vue'),
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
path: '/github',
|
|
26
|
+
name: 'Github 统计',
|
|
27
|
+
meta: {
|
|
28
|
+
title: 'Github 统计',
|
|
29
|
+
},
|
|
30
|
+
component: () => import(/* webpackChunkName: "dashboard" */ '../views/github/index.vue'),
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
path: '/sdkAppId',
|
|
34
|
+
name: '新增 sdkAppId',
|
|
35
|
+
meta: {
|
|
36
|
+
title: '新增 sdkAppId',
|
|
37
|
+
},
|
|
38
|
+
component: () => import(/* webpackChunkName: "dashboard" */ '../views/sdkAppId/index.vue'),
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
path: '/feature',
|
|
42
|
+
name: '渗透率',
|
|
43
|
+
meta: {
|
|
44
|
+
title: '渗透率',
|
|
45
|
+
},
|
|
46
|
+
component: () => import(/* webpackChunkName: "dashboard" */ '../views/feature/index.vue'),
|
|
47
|
+
},
|
|
48
|
+
],
|
|
49
|
+
},
|
|
50
|
+
];
|
|
51
|
+
|
|
52
|
+
const router = createRouter({
|
|
53
|
+
history: createWebHashHistory(),
|
|
54
|
+
routes,
|
|
55
|
+
});
|
|
56
|
+
|
|
57
|
+
router.beforeEach((to, from, next) => {
|
|
58
|
+
document.title = `${to.meta.title}`;
|
|
59
|
+
// const role = localStorage.getItem('ms_username');
|
|
60
|
+
// if (!role && to.path !== '/login') {
|
|
61
|
+
// next('/login');
|
|
62
|
+
// } else if (to.meta.permission) {
|
|
63
|
+
// // 如果是管理员权限则可进入,这里只是简单的模拟管理员权限而已
|
|
64
|
+
// role === 'admin'
|
|
65
|
+
// ? next()
|
|
66
|
+
// : next('/403');
|
|
67
|
+
// } else {
|
|
68
|
+
// next();
|
|
69
|
+
// }
|
|
70
|
+
next();
|
|
71
|
+
});
|
|
72
|
+
|
|
73
|
+
export default router;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { defineStore } from 'pinia'
|
|
2
|
+
|
|
3
|
+
export const useSidebarStore = defineStore('sidebar', {
|
|
4
|
+
state: () => {
|
|
5
|
+
return {
|
|
6
|
+
collapse: true
|
|
7
|
+
}
|
|
8
|
+
},
|
|
9
|
+
getters: {
|
|
10
|
+
|
|
11
|
+
},
|
|
12
|
+
actions: {
|
|
13
|
+
handleCollapse() {
|
|
14
|
+
this.collapse = !this.collapse;
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
})
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { defineStore } from 'pinia'
|
|
2
|
+
|
|
3
|
+
export const useTagsStore = defineStore('tags', {
|
|
4
|
+
state: () => {
|
|
5
|
+
return {
|
|
6
|
+
list: []
|
|
7
|
+
}
|
|
8
|
+
},
|
|
9
|
+
getters: {
|
|
10
|
+
show: (state) => {
|
|
11
|
+
return state.list.length > 0;
|
|
12
|
+
},
|
|
13
|
+
nameList: (state) => {
|
|
14
|
+
return state.list.map(item => item.name);
|
|
15
|
+
}
|
|
16
|
+
},
|
|
17
|
+
actions: {
|
|
18
|
+
delTagsItem(index) {
|
|
19
|
+
this.list.splice(index, 1);
|
|
20
|
+
},
|
|
21
|
+
setTagsItem(data) {
|
|
22
|
+
this.list.push(data)
|
|
23
|
+
},
|
|
24
|
+
clearTags() {
|
|
25
|
+
this.list = []
|
|
26
|
+
},
|
|
27
|
+
closeTagsOther(data) {
|
|
28
|
+
this.list = data;
|
|
29
|
+
},
|
|
30
|
+
closeCurrentTag(data) {
|
|
31
|
+
console.log(data)
|
|
32
|
+
for (let i = 0, len = this.list.length; i < len; i++) {
|
|
33
|
+
const item = this.list[i];
|
|
34
|
+
if (item.path === data.$route.fullPath) {
|
|
35
|
+
if (i < len - 1) {
|
|
36
|
+
data.$router.push(this.list[i + 1].path);
|
|
37
|
+
} else if (i > 0) {
|
|
38
|
+
data.$router.push(this.list[i - 1].path);
|
|
39
|
+
} else {
|
|
40
|
+
data.$router.push("/");
|
|
41
|
+
}
|
|
42
|
+
this.list.splice(i, 1);
|
|
43
|
+
break;
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
},
|
|
47
|
+
}
|
|
48
|
+
})
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
export default {
|
|
2
|
+
'zh-cn': {
|
|
3
|
+
i18n: {
|
|
4
|
+
breadcrumb: '国际化产品',
|
|
5
|
+
tips: '通过切换语言按钮,来改变当前内容的语言。',
|
|
6
|
+
btn: '切换英文',
|
|
7
|
+
title1: '常用用法',
|
|
8
|
+
p1: '要是你把你的秘密告诉了风,那就别怪风把它带给树。',
|
|
9
|
+
p2: '没有什么比信念更能支撑我们度过艰难的时光了。',
|
|
10
|
+
p3: '只要能把自己的事做好,并让自己快乐,你就领先于大多数人了。'
|
|
11
|
+
}
|
|
12
|
+
},
|
|
13
|
+
'en': {
|
|
14
|
+
i18n: {
|
|
15
|
+
breadcrumb: 'International Products',
|
|
16
|
+
tips: 'Click on the button to change the current language. ',
|
|
17
|
+
btn: 'Switch Chinese',
|
|
18
|
+
title1: 'Common usage',
|
|
19
|
+
p1: "If you reveal your secrets to the wind you should not blame the wind for revealing them to the trees.",
|
|
20
|
+
p2: "Nothing can help us endure dark times better than our faith. ",
|
|
21
|
+
p3: "If you can do what you do best and be happy, you're further along in life than most people."
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import axios from 'axios';
|
|
2
|
+
|
|
3
|
+
const service = axios.create({
|
|
4
|
+
// process.env.NODE_ENV === 'development' 来判断是否开发环境
|
|
5
|
+
// easy-mock服务挂了,暂时不使用了
|
|
6
|
+
// baseURL: 'https://www.easy-mock.com/mock/592501a391470c0ac1fab128',
|
|
7
|
+
timeout: 5000
|
|
8
|
+
});
|
|
9
|
+
|
|
10
|
+
service.interceptors.request.use(
|
|
11
|
+
config => {
|
|
12
|
+
return config;
|
|
13
|
+
},
|
|
14
|
+
error => {
|
|
15
|
+
console.log(error);
|
|
16
|
+
return Promise.reject();
|
|
17
|
+
}
|
|
18
|
+
);
|
|
19
|
+
|
|
20
|
+
service.interceptors.response.use(
|
|
21
|
+
response => {
|
|
22
|
+
if (response.status === 200) {
|
|
23
|
+
return response.data;
|
|
24
|
+
} else {
|
|
25
|
+
Promise.reject();
|
|
26
|
+
}
|
|
27
|
+
},
|
|
28
|
+
error => {
|
|
29
|
+
console.log(error);
|
|
30
|
+
return Promise.reject();
|
|
31
|
+
}
|
|
32
|
+
);
|
|
33
|
+
|
|
34
|
+
export default service;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 从 window.location.href 中获取指定key的value
|
|
3
|
+
* @param {*} key 要获取的 key
|
|
4
|
+
* @returns window.location.href 中指定key对应的value
|
|
5
|
+
* @example
|
|
6
|
+
* const value = getUrlParam(key);
|
|
7
|
+
*/
|
|
8
|
+
export function getUrlParam(key) {
|
|
9
|
+
const url = window.location.href.replace(/^[^?]*\?/, '');
|
|
10
|
+
const regexp = new RegExp(`(^|&)${key}=([^&#]*)(&|$|)`, 'i');
|
|
11
|
+
const paramMatch = url.match(regexp);
|
|
12
|
+
|
|
13
|
+
return paramMatch ? paramMatch[2] : null;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export function validParams(userId, roomId, sdkAppId, userSignature) {
|
|
17
|
+
const errors = [];
|
|
18
|
+
if (!userId) {
|
|
19
|
+
errors.push('"userId" is not valid');
|
|
20
|
+
}
|
|
21
|
+
if (roomId === 0) {
|
|
22
|
+
errors.push('"roomId" is not valid');
|
|
23
|
+
}
|
|
24
|
+
if (sdkAppId === 0) {
|
|
25
|
+
errors.push('"sdkAppId" is not valid');
|
|
26
|
+
}
|
|
27
|
+
if (userSignature === '') {
|
|
28
|
+
errors.push('"userSignature" is not valid');
|
|
29
|
+
}
|
|
30
|
+
if (errors.length) {
|
|
31
|
+
console.error(errors);
|
|
32
|
+
return false;
|
|
33
|
+
}
|
|
34
|
+
return true;
|
|
35
|
+
}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="about">
|
|
3
|
+
<v-header />
|
|
4
|
+
<v-sidebar />
|
|
5
|
+
<div class="content-box" :class="{ 'content-collapse': sidebar.collapse }">
|
|
6
|
+
<!-- <v-tags></v-tags> -->
|
|
7
|
+
<div class="content">
|
|
8
|
+
<router-view v-slot="{ Component }">
|
|
9
|
+
<transition name="move" mode="out-in">
|
|
10
|
+
<keep-alive :include="tags.nameList">
|
|
11
|
+
<component :is="Component" />
|
|
12
|
+
</keep-alive>
|
|
13
|
+
</transition>
|
|
14
|
+
</router-view>
|
|
15
|
+
<!-- <el-backtop target=".content"></el-backtop> -->
|
|
16
|
+
</div>
|
|
17
|
+
</div>
|
|
18
|
+
</div>
|
|
19
|
+
</template>
|
|
20
|
+
<script>
|
|
21
|
+
import { useSidebarStore } from '../store/sidebar'
|
|
22
|
+
import { useTagsStore } from '../store/tags'
|
|
23
|
+
import vHeader from "../components/Header.vue";
|
|
24
|
+
import vSidebar from "../components/Sidebar.vue";
|
|
25
|
+
import vTags from "../components/Tags.vue";
|
|
26
|
+
export default {
|
|
27
|
+
components: {
|
|
28
|
+
vHeader,
|
|
29
|
+
vSidebar,
|
|
30
|
+
vTags,
|
|
31
|
+
},
|
|
32
|
+
setup() {
|
|
33
|
+
const sidebar = useSidebarStore();
|
|
34
|
+
const tags = useTagsStore();
|
|
35
|
+
return {
|
|
36
|
+
tags,
|
|
37
|
+
sidebar,
|
|
38
|
+
};
|
|
39
|
+
},
|
|
40
|
+
};
|
|
41
|
+
</script>
|
|
42
|
+
<style>
|
|
43
|
+
.content {
|
|
44
|
+
padding: 0px;
|
|
45
|
+
}
|
|
46
|
+
</style>
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<section class="main">
|
|
3
|
+
<div class="crumbs">
|
|
4
|
+
<el-breadcrumb separator="/">
|
|
5
|
+
<el-breadcrumb-item>
|
|
6
|
+
<i class="el-icon-lx-global"></i>
|
|
7
|
+
{{$t('i18n.breadcrumb')}}
|
|
8
|
+
</el-breadcrumb-item>
|
|
9
|
+
</el-breadcrumb>
|
|
10
|
+
</div>
|
|
11
|
+
<div class="container">
|
|
12
|
+
<span>{{$t('i18n.tips')}}</span>
|
|
13
|
+
<el-button
|
|
14
|
+
type="primary"
|
|
15
|
+
@click="$i18n.locale = $i18n.locale === 'zh-cn'?'en':'zh-cn';"
|
|
16
|
+
>{{$t('i18n.btn')}}</el-button>
|
|
17
|
+
<div class="list">
|
|
18
|
+
<h2>{{$t('i18n.title1')}}</h2>
|
|
19
|
+
<p>{{$t('i18n.p1')}}</p>
|
|
20
|
+
<p>{{$t('i18n.p2')}}</p>
|
|
21
|
+
<p>{{$t('i18n.p3')}}</p>
|
|
22
|
+
</div>
|
|
23
|
+
</div>
|
|
24
|
+
</section>
|
|
25
|
+
</template>
|
|
26
|
+
|
|
27
|
+
<script>
|
|
28
|
+
export default {
|
|
29
|
+
name: "i18n"
|
|
30
|
+
};
|
|
31
|
+
</script>
|
|
32
|
+
|
|
33
|
+
<style scoped>
|
|
34
|
+
.list {
|
|
35
|
+
padding: 30px 0;
|
|
36
|
+
}
|
|
37
|
+
.list p {
|
|
38
|
+
margin-bottom: 20px;
|
|
39
|
+
}
|
|
40
|
+
</style>
|
|
@@ -0,0 +1,229 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div>
|
|
3
|
+
<div class="crumbs">
|
|
4
|
+
<el-breadcrumb separator="/">
|
|
5
|
+
<el-breadcrumb-item>
|
|
6
|
+
<i class="el-icon-lx-emoji"></i> 自定义图标
|
|
7
|
+
</el-breadcrumb-item>
|
|
8
|
+
</el-breadcrumb>
|
|
9
|
+
</div>
|
|
10
|
+
<div class="container">
|
|
11
|
+
<h2>使用方法</h2>
|
|
12
|
+
<p style="line-height: 50px;">直接通过设置类名为 el-icon-lx-iconName 来使用即可。例如:(共{{iconList.length}}个图标)</p>
|
|
13
|
+
<p class="example-p">
|
|
14
|
+
<i class="el-icon-lx-redpacket_fill" style="font-size: 30px;color: #ff5900"></i>
|
|
15
|
+
<span><i class="el-icon-lx-redpacket_fill"></i></span>
|
|
16
|
+
</p>
|
|
17
|
+
<p class="example-p">
|
|
18
|
+
<i class="el-icon-lx-weibo" style="font-size: 30px;color:#fd5656"></i>
|
|
19
|
+
<span><i class="el-icon-lx-weibo"></i></span>
|
|
20
|
+
</p>
|
|
21
|
+
<p class="example-p">
|
|
22
|
+
<i class="el-icon-lx-emojifill" style="font-size: 30px;color: #ffc300"></i>
|
|
23
|
+
<span><i class="el-icon-lx-emojifill"></i></span>
|
|
24
|
+
</p>
|
|
25
|
+
<br />
|
|
26
|
+
<h2>图标</h2>
|
|
27
|
+
<div class="search-box">
|
|
28
|
+
<el-input class="search" size="large" v-model="keyword" clearable placeholder="请输入图标名称"></el-input>
|
|
29
|
+
</div>
|
|
30
|
+
<ul>
|
|
31
|
+
<li class="icon-li" v-for="(item,index) in list" :key="index">
|
|
32
|
+
<div class="icon-li-content">
|
|
33
|
+
<i :class="`el-icon-lx-${item}`"></i>
|
|
34
|
+
<span>{{item}}</span>
|
|
35
|
+
</div>
|
|
36
|
+
</li>
|
|
37
|
+
</ul>
|
|
38
|
+
</div>
|
|
39
|
+
</div>
|
|
40
|
+
</template>
|
|
41
|
+
|
|
42
|
+
<script>
|
|
43
|
+
import { computed, ref } from "vue";
|
|
44
|
+
export default {
|
|
45
|
+
name: "icon",
|
|
46
|
+
setup() {
|
|
47
|
+
const iconList = [
|
|
48
|
+
"attentionforbid",
|
|
49
|
+
"attentionforbidfill",
|
|
50
|
+
"attention",
|
|
51
|
+
"attentionfill",
|
|
52
|
+
"tag",
|
|
53
|
+
"tagfill",
|
|
54
|
+
"people",
|
|
55
|
+
"peoplefill",
|
|
56
|
+
"notice",
|
|
57
|
+
"noticefill",
|
|
58
|
+
"mobile",
|
|
59
|
+
"mobilefill",
|
|
60
|
+
"voice",
|
|
61
|
+
"voicefill",
|
|
62
|
+
"unlock",
|
|
63
|
+
"lock",
|
|
64
|
+
"home",
|
|
65
|
+
"homefill",
|
|
66
|
+
"delete",
|
|
67
|
+
"deletefill",
|
|
68
|
+
"notification",
|
|
69
|
+
"notificationfill",
|
|
70
|
+
"notificationforbidfill",
|
|
71
|
+
"like",
|
|
72
|
+
"likefill",
|
|
73
|
+
"comment",
|
|
74
|
+
"commentfill",
|
|
75
|
+
"camera",
|
|
76
|
+
"camerafill",
|
|
77
|
+
"warn",
|
|
78
|
+
"warnfill",
|
|
79
|
+
"time",
|
|
80
|
+
"timefill",
|
|
81
|
+
"location",
|
|
82
|
+
"locationfill",
|
|
83
|
+
"favor",
|
|
84
|
+
"favorfill",
|
|
85
|
+
"skin",
|
|
86
|
+
"skinfill",
|
|
87
|
+
"news",
|
|
88
|
+
"newsfill",
|
|
89
|
+
"record",
|
|
90
|
+
"recordfill",
|
|
91
|
+
"emoji",
|
|
92
|
+
"emojifill",
|
|
93
|
+
"message",
|
|
94
|
+
"messagefill",
|
|
95
|
+
"goods",
|
|
96
|
+
"goodsfill",
|
|
97
|
+
"crown",
|
|
98
|
+
"crownfill",
|
|
99
|
+
"move",
|
|
100
|
+
"add",
|
|
101
|
+
"hot",
|
|
102
|
+
"hotfill",
|
|
103
|
+
"service",
|
|
104
|
+
"servicefill",
|
|
105
|
+
"present",
|
|
106
|
+
"presentfill",
|
|
107
|
+
"pic",
|
|
108
|
+
"picfill",
|
|
109
|
+
"rank",
|
|
110
|
+
"rankfill",
|
|
111
|
+
"male",
|
|
112
|
+
"female",
|
|
113
|
+
"down",
|
|
114
|
+
"top",
|
|
115
|
+
"recharge",
|
|
116
|
+
"rechargefill",
|
|
117
|
+
"forward",
|
|
118
|
+
"forwardfill",
|
|
119
|
+
"info",
|
|
120
|
+
"infofill",
|
|
121
|
+
"redpacket",
|
|
122
|
+
"redpacket_fill",
|
|
123
|
+
"roundadd",
|
|
124
|
+
"roundaddfill",
|
|
125
|
+
"friendadd",
|
|
126
|
+
"friendaddfill",
|
|
127
|
+
"cart",
|
|
128
|
+
"cartfill",
|
|
129
|
+
"more",
|
|
130
|
+
"moreandroid",
|
|
131
|
+
"back",
|
|
132
|
+
"right",
|
|
133
|
+
"shop",
|
|
134
|
+
"shopfill",
|
|
135
|
+
"question",
|
|
136
|
+
"questionfill",
|
|
137
|
+
"roundclose",
|
|
138
|
+
"roundclosefill",
|
|
139
|
+
"roundcheck",
|
|
140
|
+
"roundcheckfill",
|
|
141
|
+
"global",
|
|
142
|
+
"mail",
|
|
143
|
+
"punch",
|
|
144
|
+
"exit",
|
|
145
|
+
"upload",
|
|
146
|
+
"read",
|
|
147
|
+
"file",
|
|
148
|
+
"link",
|
|
149
|
+
"full",
|
|
150
|
+
"group",
|
|
151
|
+
"friend",
|
|
152
|
+
"profile",
|
|
153
|
+
"addressbook",
|
|
154
|
+
"calendar",
|
|
155
|
+
"text",
|
|
156
|
+
"copy",
|
|
157
|
+
"share",
|
|
158
|
+
"wifi",
|
|
159
|
+
"vipcard",
|
|
160
|
+
"weibo",
|
|
161
|
+
"remind",
|
|
162
|
+
"refresh",
|
|
163
|
+
"filter",
|
|
164
|
+
"settings",
|
|
165
|
+
"scan",
|
|
166
|
+
"qrcode",
|
|
167
|
+
"cascades",
|
|
168
|
+
"apps",
|
|
169
|
+
"sort",
|
|
170
|
+
"searchlist",
|
|
171
|
+
"search",
|
|
172
|
+
"edit",
|
|
173
|
+
];
|
|
174
|
+
const keyword = ref("");
|
|
175
|
+
const list = computed(() => {
|
|
176
|
+
return iconList.filter((item) => {
|
|
177
|
+
return item.indexOf(keyword.value) !== -1;
|
|
178
|
+
});
|
|
179
|
+
});
|
|
180
|
+
|
|
181
|
+
return {
|
|
182
|
+
iconList,
|
|
183
|
+
keyword,
|
|
184
|
+
list,
|
|
185
|
+
};
|
|
186
|
+
},
|
|
187
|
+
};
|
|
188
|
+
</script>
|
|
189
|
+
|
|
190
|
+
<style scoped>
|
|
191
|
+
.example-p {
|
|
192
|
+
height: 45px;
|
|
193
|
+
display: flex;
|
|
194
|
+
align-items: center;
|
|
195
|
+
}
|
|
196
|
+
.search-box {
|
|
197
|
+
text-align: center;
|
|
198
|
+
margin-top: 10px;
|
|
199
|
+
}
|
|
200
|
+
.search {
|
|
201
|
+
width: 300px;
|
|
202
|
+
}
|
|
203
|
+
ul,
|
|
204
|
+
li {
|
|
205
|
+
list-style: none;
|
|
206
|
+
}
|
|
207
|
+
.icon-li {
|
|
208
|
+
display: inline-block;
|
|
209
|
+
padding: 10px;
|
|
210
|
+
width: 120px;
|
|
211
|
+
height: 120px;
|
|
212
|
+
}
|
|
213
|
+
.icon-li-content {
|
|
214
|
+
display: flex;
|
|
215
|
+
height: 100%;
|
|
216
|
+
flex-direction: column;
|
|
217
|
+
align-items: center;
|
|
218
|
+
justify-content: center;
|
|
219
|
+
cursor: pointer;
|
|
220
|
+
}
|
|
221
|
+
.icon-li-content i {
|
|
222
|
+
font-size: 36px;
|
|
223
|
+
color: #606266;
|
|
224
|
+
}
|
|
225
|
+
.icon-li-content span {
|
|
226
|
+
margin-top: 10px;
|
|
227
|
+
color: #787878;
|
|
228
|
+
}
|
|
229
|
+
</style>
|