renusify 1.2.0 → 1.2.1

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.
@@ -10,74 +10,17 @@ export default {
10
10
  template: String,
11
11
  script: String
12
12
  },
13
- methods: {
14
- strToObj2(str) {
15
- str = str.trim()
16
- str = this.$helper.replacer(str, "\n", '')
17
- str = this.$helper.replacer(str, "\r", '')
18
- let open = 0
19
- let pre = 0
20
- let to = 0
21
- let items = []
22
- const s = str
23
- s.split('').forEach((c, i) => {
24
- to++
25
- if (c === '{') {
26
- open++
27
- }
28
- if (c === '}') {
29
- open--
30
- }
31
- if (open === 0 && c === ',') {
32
- items.push(str.substr(pre, to - 1))
33
- pre = i + 1
34
- to = 0
35
- }
36
- })
37
- items.push(str.substr(pre, str.length))
38
- return items
39
- },
40
- strToObj(str) {
41
- str = str.trim()
42
- if (str.substr(0, 1) === '{') {
43
- str = str.substr(1, str.length - 2)
44
- }
45
- let res = {}
46
- this.strToObj2(str).forEach((item) => {
47
- item = item.trim()
48
- const f = item.indexOf('(')
49
- const o = item.indexOf(':')
50
-
51
- if ((f > 0 && f < o) || o < 0) {
52
- res[item.substr(0, f)] = eval("(" + 'function ' + item + ")");
53
- } else {
54
-
55
- item = [item.substr(0, o).trim(), item.substr(o, item.length).replace(':', '').trim()]
56
- if (item[1].substr(0, 1) === '{') {
57
- res[item[0]] = this.strToObj(item[1])
58
- } else {
59
- res[item[0]] = eval(item[1])
60
- }
61
-
62
- }
63
- })
64
-
65
- return res
66
- },
67
- },
68
13
  computed: {
69
14
  page() {
70
15
  let temp = this.template || ''
71
16
  let scr = this.script || 'name:"test"'
72
-
73
17
  scr = this.$helper.replacer(scr, '&lt;', '<')
74
18
  scr = this.$helper.replacer(scr, '&gt;', '>')
75
-
76
19
  return defineAsyncComponent(() =>
77
20
  new Promise((resolve, reject) => {
78
21
  resolve({
79
22
  template: temp,
80
- ...this.strToObj(scr)
23
+ ...eval('Object({' + scr + '})')
81
24
  })
82
25
  }))
83
26
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "renusify",
3
- "version": "1.2.0",
3
+ "version": "1.2.1",
4
4
  "description": "Vue3 Framework",
5
5
  "keywords": [
6
6
  "vuejs",