@shijiu/jsview-vue 0.9.272 → 0.9.277

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.
@@ -11,22 +11,27 @@
11
11
  </div>
12
12
  </template>
13
13
 
14
- <script setup>
15
- /* eslint-disable no-unused-vars */
16
- const titleStyle = {
17
- width: 100,
18
- height: 20,
19
- textAlign: 'center',
20
- lineHeight: 20
21
- };
22
-
23
- const itemStyle = {
24
- top: 20,
25
- width: 50,
26
- height: 50,
27
- backgroundColor: 'rgba(255, 0, 0, 1)'
28
- };
29
-
14
+ <script>
15
+ export default {
16
+ computed: {
17
+ titleStyle() {
18
+ return {
19
+ width: 100,
20
+ height: 20,
21
+ textAlign: 'center',
22
+ lineHeight: 20
23
+ }
24
+ },
25
+ itemStyle() {
26
+ return {
27
+ top: 20,
28
+ width: 50,
29
+ height: 50,
30
+ backgroundColor: 'rgba(255, 0, 0, 1)'
31
+ }
32
+ }
33
+ }
34
+ }
30
35
  </script>
31
36
 
32
37
  <style>
@@ -41,71 +41,75 @@
41
41
  </div>
42
42
  </template>
43
43
 
44
- <script setup>
45
- /* eslint-disable no-unused-vars */
46
- import { defineProps, onMounted, onBeforeUnmount } from "vue";
47
-
48
-
49
- const props = defineProps({
50
- timeCount: Number,
51
- })
52
-
53
- var state = {
54
- transform: null,
55
- transformOrigin: null,
56
- transformTranslate: null,
57
- transformRotate: null,
58
- transformScale: null,
59
- };
60
-
61
- var timerId = -1;
62
-
63
- onMounted(() => {
64
- changeState();
65
- timerId = setInterval(() => {
66
- changeState();
67
- }, 6000);
68
- });
69
-
70
- onBeforeUnmount(() => {
71
- if (timerId >= 0) {
72
- window.clearInterval(timerId);
44
+ <script>
45
+ export default {
46
+ props: {
47
+ timeCount: Number,
48
+ },
49
+ computed: {
50
+ titleStyle() {
51
+ return {
52
+ width: 100,
53
+ height: 20,
54
+ textAlign: 'left',
55
+ lineHeight: 20
56
+ }
57
+ },
58
+ itemStyle() {
59
+ return {
60
+ top: 20,
61
+ width: 50, height: 50,
62
+ whiteSpace: 'pre-wrap',
63
+ backgroundColor: 'rgba(255, 0, 0, 1)'
64
+ }
73
65
  }
74
- timerId = -1;
75
- });
76
-
77
- function changeState() {
78
- setTimeout(() => {
66
+ },
67
+ methods: {
68
+ changeState() {
69
+ setTimeout(() => {
79
70
  // 状态变更
80
- state.transform = 'translate3d(80px,0px,0) scale3d(2,2,1.0) rotate3d(0, 0, 1, 360deg)';
81
- state.transformOrigin = 'center center';
82
- state.transformScale = 'scale3d(0.2,0.2,1.0)';
83
- state.transformRotate = 'rotate3d(0, 0, 1.0, 360deg)';
84
- state.transformTranslate = 'translate3d(180px,0px,0)';
71
+ this.state.transform = 'translate3d(80px,0px,0) scale3d(2,2,1.0) rotate3d(0, 0, 1, 360deg)';
72
+ this.state.transformOrigin = 'center center';
73
+ this.state.transformScale = 'scale3d(0.2,0.2,1.0)';
74
+ this.state.transformRotate = 'rotate3d(0, 0, 1.0, 360deg)';
75
+ this.state.transformTranslate = 'translate3d(180px,0px,0)';
85
76
  // 状态变更
86
77
  setTimeout(() => {
87
- state.transform = 'translate3d(30px,0px,0) scale3d(0.2,0.2,1.0) rotate3d(0, 0, 1, -360deg)';
88
- state.transformOrigin = 'center center';
89
- state.transformScale = 'scale3d(1.2,1.2,1.0)';
90
- state.transformRotate = 'rotate3d(0, 0, 1.0, -360deg)';
91
- state.transformTranslate = 'translate3d(-80px,0px,0)';
78
+ this.state.transform = 'translate3d(30px,0px,0) scale3d(0.2,0.2,1.0) rotate3d(0, 0, 1, -360deg)';
79
+ this.state.transformOrigin = 'center center';
80
+ this.state.transformScale = 'scale3d(1.2,1.2,1.0)';
81
+ this.state.transformRotate = 'rotate3d(0, 0, 1.0, -360deg)';
82
+ this.state.transformTranslate = 'translate3d(-80px,0px,0)';
92
83
  }, 3000);
93
- }, 3000);
94
- }
95
-
96
- const titleStyle = {
97
- width: 100,
98
- height: 20,
99
- textAlign: 'left',
100
- lineHeight: 20
101
- };
84
+ }, 3000);
85
+ }
86
+ },
87
+ data() {
88
+ return {
89
+ timerId: -1,
90
+ state: {
91
+ transform: null,
92
+ transformOrigin: null,
93
+ transformTranslate: null,
94
+ transformRotate: null,
95
+ transformScale: null,
96
+ }
97
+ }
98
+ },
99
+ mounted() {
100
+ this.changeState();
101
+ this.timerId = setInterval(() => {
102
+ this.changeState();
103
+ }, 6000);
104
+ },
105
+ beforeUnmount() {
106
+ if (this.timerId >= 0) {
107
+ window.clearInterval(this.timerId);
108
+ }
109
+ this.timerId = -1;
110
+ }
102
111
 
103
- const itemStyle = {
104
- top: 20,
105
- width: 50, height: 50,
106
- whiteSpace: 'pre-wrap',
107
- backgroundColor: 'rgba(255, 0, 0, 1)'
108
- };
112
+ }
109
113
  </script>
110
114
 
111
115
  <style>
@@ -5,9 +5,16 @@
5
5
  </div>;
6
6
  </template>
7
7
 
8
- <script setup>
9
- /* eslint-disable no-unused-vars */
8
+ <script>
10
9
  import iconImgPath from '../../assets/icon.png';
10
+
11
+ export default {
12
+ computed: {
13
+ iconImgPath() {
14
+ return iconImgPath
15
+ }
16
+ }
17
+ }
11
18
  </script>
12
19
 
13
20
  <style>
@@ -60,19 +60,32 @@
60
60
  </div>
61
61
  </template>
62
62
 
63
- <script setup>
64
- /* eslint-disable no-unused-vars */
63
+ <script>
65
64
  import testImgPath from '../../assets/test.jpg';
66
65
 
67
- const titleHeight = 16;
68
- const imageSize = {
69
- width: 80,
70
- height: 64,
71
- };
72
- const clipSize = {
73
- width: 50,
74
- height: 40,
75
- };
66
+ export default {
67
+ computed: {
68
+ testImgPath() {
69
+ return testImgPath;
70
+ },
71
+ titleHeight() {
72
+ return 16;
73
+ },
74
+ imageSize() {
75
+ return {
76
+ width: 80,
77
+ height: 64,
78
+ }
79
+ },
80
+ clipSize() {
81
+ return {
82
+ width: 50,
83
+ height: 40,
84
+ }
85
+ }
86
+ }
87
+ }
88
+
76
89
  </script>
77
90
 
78
91
 
@@ -10,34 +10,43 @@
10
10
  </div>
11
11
  </template>
12
12
 
13
- <script setup>
14
- /* eslint-disable no-unused-vars */
15
- import { reactive, onMounted, onBeforeUnmount } from "vue";
13
+ <script>
14
+ import { reactive } from "vue";
16
15
 
17
- const state = reactive({
18
- foreColor: '#FF0000',
19
- backColor: '#00FF00',
20
- })
21
-
22
- var timerId = -1;
23
- onMounted(() => {
24
- timerId = setInterval(() => {
25
- if(state.foreColor == '#00FF00') {
26
- state.foreColor = '#FF0000'
27
- state.backColor = '#00FF00'
28
- } else {
29
- state.foreColor = '#00FF00'
30
- state.backColor = '#FF0000'
16
+ export default {
17
+ computed: {
18
+ iconImgPath() {
19
+ return iconImgPath
31
20
  }
32
- }, 3000);
33
- });
34
-
35
- onBeforeUnmount(() => {
36
- if (timerId >= 0) {
37
- window.clearInterval(timerId);
21
+ },
22
+ data() {
23
+ return {
24
+ timerId: -1,
25
+ state: reactive({
26
+ foreColor: '#FF0000',
27
+ backColor: '#00FF00',
28
+ }),
29
+ }
30
+ },
31
+ mounted() {
32
+ this.timerId = setInterval(() => {
33
+ if(this.state.foreColor == '#00FF00') {
34
+ this.state.foreColor = '#FF0000'
35
+ this.state.backColor = '#00FF00'
36
+ } else {
37
+ this.state.foreColor = '#00FF00'
38
+ this.state.backColor = '#FF0000'
39
+ }
40
+ }, 3000);
41
+ },
42
+ beforeUnmount() {
43
+ if (this.timerId >= 0) {
44
+ window.clearInterval(this.timerId);
45
+ }
46
+ this.timerId = -1;
38
47
  }
39
- timerId = -1;
40
- });
48
+ }
49
+
41
50
  </script>
42
51
 
43
52
  <style scoped>
@@ -12,22 +12,30 @@
12
12
  </div>
13
13
  </template>
14
14
 
15
- <script setup>
16
- /* eslint-disable no-unused-vars */
17
- import { defineProps } from "vue";
15
+ <script>
18
16
  import ContentBlock from '../ContentBlock';
19
17
  import DivBackground from './DivBackground';
20
18
  import DivClip from './DivClip';
21
19
  import DivLayout from './DivLayout';
22
20
 
23
- const name = 'DivGroup1';
24
- const props = defineProps({
25
- contentClass: String,
26
- itemSides: Object
27
- })
28
-
29
- const contentBlockProps = {
30
- colIndex: 0,
31
- itemSides: props.itemSides
32
- };
21
+ export default {
22
+ props: {
23
+ contentClass: String,
24
+ itemSides: Object
25
+ },
26
+ components: {
27
+ ContentBlock,
28
+ DivBackground,
29
+ DivClip,
30
+ DivLayout,
31
+ },
32
+ computed: {
33
+ contentBlockProps() {
34
+ return {
35
+ colIndex: 0,
36
+ itemSides: this.itemSides
37
+ }
38
+ }
39
+ }
40
+ }
33
41
  </script>
@@ -12,24 +12,32 @@
12
12
  </div>
13
13
  </template>
14
14
 
15
- <script setup>
16
- /* eslint-disable no-unused-vars */
17
- import { defineProps } from "vue";
15
+ <script>
18
16
  import ContentBlock from '../ContentBlock';
19
17
  import DivCssScoped from './DivCssScoped';
20
18
  import DivCssVar from './DivCssVar';
21
19
  import DivRadius from './DivRadius';
22
20
 
23
- const name = 'DivGroup2';
24
- const props = defineProps({
25
- contentClass: String,
26
- itemSides: Object
27
- })
28
-
29
- const contentBlockProps = {
30
- colIndex: 0,
31
- itemSides: props.itemSides
32
- };
21
+ export default {
22
+ props: {
23
+ contentClass: String,
24
+ itemSides: Object
25
+ },
26
+ components: {
27
+ ContentBlock,
28
+ DivCssScoped,
29
+ DivCssVar,
30
+ DivRadius,
31
+ },
32
+ computed: {
33
+ contentBlockProps() {
34
+ return {
35
+ colIndex: 0,
36
+ itemSides: this.itemSides
37
+ }
38
+ }
39
+ }
40
+ }
33
41
  </script>
34
42
 
35
43
  <style scoped>
@@ -27,19 +27,28 @@
27
27
  borderRadius: '0 10px 20px 30px'}">
28
28
  各角不同
29
29
  </div>
30
- </div>;
30
+ </div>
31
31
  </template>
32
32
 
33
- <script setup>
34
- /* eslint-disable no-unused-vars */
33
+ <script>
35
34
  import iconImgPath from '../../assets/icon.png';
36
35
 
37
- const blockSize = {
38
- width: 65,
39
- height: 65,
40
- };
41
-
42
- const gap = 5;
36
+ export default {
37
+ computed: {
38
+ iconImgPath() {
39
+ return iconImgPath
40
+ },
41
+ blockSize() {
42
+ return {
43
+ width: 65,
44
+ height: 65,
45
+ }
46
+ },
47
+ gap() {
48
+ return 5;
49
+ }
50
+ }
51
+ }
43
52
  </script>
44
53
 
45
54
  <style>
@@ -28,19 +28,27 @@
28
28
  </div>
29
29
  </template>
30
30
 
31
- <script setup>
32
- /* eslint-disable no-unused-vars */
33
- const blockSize = {
34
- width: 90,
35
- height: 40,
36
- };
31
+ <script>
32
+ export default {
33
+ computed: {
34
+ blockSize() {
35
+ return {
36
+ width: 90,
37
+ height: 40,
38
+ }
39
+ },
40
+ blockStyle() {
41
+ return {
42
+ width: this.blockSize.width,
43
+ height: this.blockSize.height,
44
+ backgroundColor: 'rgba(255, 255, 0, 0.5)',
45
+ color: 'rgba(255, 0, 0, 1)',
46
+ }
47
+ }
48
+ }
49
+ }
37
50
 
38
- const blockStyle = {
39
- width: blockSize.width,
40
- height: blockSize.height,
41
- backgroundColor: 'rgba(255, 255, 0, 0.5)',
42
- color: 'rgba(255, 0, 0, 1)',
43
- };
51
+ /* eslint-disable no-unused-vars */
44
52
  </script>
45
53
 
46
54
  <style>
@@ -43,14 +43,21 @@
43
43
  </div>
44
44
  </template>
45
45
 
46
- <script setup>
47
- /* eslint-disable no-unused-vars */
48
- const gap = 5;
46
+ <script>
47
+ export default {
48
+ computed: {
49
+ gap() {
50
+ return 5;
51
+ },
49
52
 
50
- const blockStyle = {
51
- width: 70,
52
- height: 20
53
- };
53
+ blockStyle() {
54
+ return {
55
+ width: 70,
56
+ height: 20
57
+ }
58
+ }
59
+ }
60
+ }
54
61
  </script>
55
62
 
56
63
  <style>
@@ -12,21 +12,30 @@
12
12
  </div>
13
13
  </template>
14
14
 
15
- <script setup>
16
- /* eslint-disable no-unused-vars */
17
- import { defineProps } from "vue";
15
+ <script>
18
16
  import ContentBlock from '../ContentBlock';
19
17
  import TextAlign from './TextAlign';
20
18
  import TextFontStyle from './TextFontStyle';
21
19
  import TextOverflow from './TextOverflow';
22
20
 
23
- const name = 'DivGroup2';
24
- const props = defineProps({
25
- contentClass: String,
26
- itemSides: Object
27
- })
28
- const contentBlockProps = {
29
- colIndex: 0,
30
- itemSides: props.itemSides
31
- };
21
+ export default {
22
+ props: {
23
+ contentClass: String,
24
+ itemSides: Object
25
+ },
26
+ components: {
27
+ ContentBlock,
28
+ TextAlign,
29
+ TextFontStyle,
30
+ TextOverflow
31
+ },
32
+ computed: {
33
+ contentBlockProps() {
34
+ return {
35
+ colIndex: 0,
36
+ itemSides: this.itemSides
37
+ }
38
+ }
39
+ }
40
+ }
32
41
  </script>
@@ -50,26 +50,34 @@
50
50
  </div>
51
51
  </template>
52
52
 
53
- <script setup>
54
- /* eslint-disable no-unused-vars */
55
- const gap = 2;
56
-
57
- const blockSize = {
58
- width: 180,
59
- height: 35,
60
- };
61
-
62
- const baseStyle = {
63
- width: blockSize.width, height: blockSize.height,
64
- backgroundColor: 'rgba(255, 255, 0, 0.5)',
65
- color: 'rgba(255, 0, 0, 1)',
66
- };
67
-
68
- // 多行的处理,在PC端依靠CSS属性 white-space: pre-line,在JsView平台不需要特别属性
69
- const multiLine = "多行文字(末尾省略):"
70
- + "\n第一行:我末尾有个\"\\n\""
71
- + "\n第二行:一二三四五六七八九十,一二三四五六七八九十,一二三四五六七八九十"
72
- + "\n第三行:一二三四五六七八九十,一二三四五六七八九十,一二三四五六七八九十";
53
+ <script>
54
+ export default {
55
+ computed: {
56
+ gap() {
57
+ return 5;
58
+ },
59
+ blockSize() {
60
+ return {
61
+ width: 180,
62
+ height: 35,
63
+ }
64
+ },
65
+ baseStyle() {
66
+ return {
67
+ width: this.blockSize.width, height: this.blockSize.height,
68
+ backgroundColor: 'rgba(255, 255, 0, 0.5)',
69
+ color: 'rgba(255, 0, 0, 1)',
70
+ }
71
+ },
72
+ // 多行的处理,在PC端依靠CSS属性 white-space: pre-line,在JsView平台不需要特别属性
73
+ multiLine() {
74
+ return "多行文字(末尾省略):"
75
+ + "\n第一行:我末尾有个\"\\n\""
76
+ + "\n第二行:一二三四五六七八九十,一二三四五六七八九十,一二三四五六七八九十"
77
+ + "\n第三行:一二三四五六七八九十,一二三四五六七八九十,一二三四五六七八九十";
78
+ }
79
+ }
80
+ }
73
81
 
74
82
  </script>
75
83