File tree Expand file tree Collapse file tree 3 files changed +70
-0
lines changed Expand file tree Collapse file tree 3 files changed +70
-0
lines changed Original file line number Diff line number Diff line change
1
+ <template >
2
+ <!-- Doc: https://www.vlibras.gov.br/doc/widget/installation/webpageintegration.html -->
3
+ <div
4
+ vw
5
+ class =" enabled"
6
+ >
7
+ <div
8
+ vw-access-button
9
+ class =" active"
10
+ />
11
+ <div vw-plugin-wrapper >
12
+ <div class =" vw-plugin-top-wrapper" />
13
+ </div >
14
+ </div >
15
+ </template >
16
+
17
+ <script >
18
+ let script = null
19
+
20
+ export default {
21
+ name: ' VLibras' ,
22
+
23
+ props: {
24
+ src: {
25
+ type: String ,
26
+ default: ' https://vlibras.gov.br/app/vlibras-plugin.js'
27
+ },
28
+
29
+ urlWidget: {
30
+ type: String ,
31
+ default: ' https://vlibras.gov.br/app'
32
+ }
33
+ },
34
+
35
+ mounted () {
36
+ this .init ()
37
+ },
38
+
39
+ methods: {
40
+ init () {
41
+ script = document .createElement (' script' )
42
+ script .addEventListener (' load' , this .createWidget )
43
+ script .src = this .src
44
+ document .querySelector (' body' ).appendChild (script)
45
+ },
46
+
47
+ createWidget () {
48
+ script .removeEventListener (' load' , this .createWidget )
49
+ // eslint-disable-next-line
50
+ new window.VLibras.Widget (this .urlWidget )
51
+ }
52
+ }
53
+ }
54
+ </script >
Original file line number Diff line number Diff line change
1
+ import VLibrasPlugin from './plugin'
2
+
3
+ export default VLibrasPlugin
4
+ export { default as VLibras } from './VLibras.vue'
Original file line number Diff line number Diff line change
1
+ import VLibras from './VLibras.vue'
2
+
3
+ export default function install ( Vue ) {
4
+ if ( install . installed ) return
5
+ install . installed = true
6
+ Vue . component ( 'VLibras' , VLibras )
7
+ }
8
+
9
+ // auto install
10
+ if ( typeof window !== 'undefined' && typeof window . Vue !== 'undefined' ) {
11
+ window . Vue . use ( install )
12
+ }
You can’t perform that action at this time.
0 commit comments