@shijiu/jsview-vue-samples 2.0.1021 → 2.0.1073
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/Basic/components/div/DivBackground.vue +1 -1
- package/Basic/components/div/DivCssVar.vue +34 -16
- package/CommonUtils/ResourceData.js +11 -0
- package/CommonUtils/getSearchQuery.js +44 -0
- package/CssPreprocessor/Less/App.vue +1 -1
- package/CssPreprocessor/Less/components/less-group1/LessComments.vue +2 -2
- package/CssPreprocessor/Less/components/less-group1/LessConditionals.vue +2 -2
- package/CssPreprocessor/Less/components/less-group1/LessVariables.vue +6 -6
- package/CssPreprocessor/Less/components/less-group2/LessIteration.vue +1 -1
- package/CssPreprocessor/Less/components/less-group2/LessMethods.vue +2 -2
- package/CssPreprocessor/Less/components/less-group3/LessExtends.vue +2 -2
- package/CssPreprocessor/Less/components/less-group3/LessNesting.vue +4 -4
- package/CssPreprocessor/Less/components/less-group4/LessKeyframes.vue +1 -1
- package/CssPreprocessor/Less/components/less-group4/LessMaps.vue +1 -1
- package/CssPreprocessor/Less/components/less-group4/LessMixins.vue +1 -1
- package/CssPreprocessor/Less/components/less-group5/LessImporting.vue +7 -3
- package/CssPreprocessor/Less/components/less-group5/TextSettings.less +8 -1
- package/CssPreprocessor/Scss/App.vue +1 -1
- package/CssPreprocessor/Scss/components/scss-group1/ScssComments.vue +11 -10
- package/CssPreprocessor/Scss/components/scss-group1/ScssConditionals.vue +8 -6
- package/CssPreprocessor/Scss/components/scss-group1/ScssOperations.vue +2 -2
- package/CssPreprocessor/Scss/components/scss-group1/ScssVariables.vue +6 -6
- package/CssPreprocessor/Scss/components/scss-group2/ScssIteration.vue +2 -2
- package/CssPreprocessor/Scss/components/scss-group2/ScssMethods.vue +9 -9
- package/CssPreprocessor/Scss/components/scss-group3/ScssExtends.vue +2 -2
- package/CssPreprocessor/Scss/components/scss-group3/ScssNesting.vue +3 -3
- package/CssPreprocessor/Scss/components/scss-group4/ScssKeyframes.vue +1 -1
- package/CssPreprocessor/Scss/components/scss-group4/ScssMaps.vue +1 -1
- package/CssPreprocessor/Scss/components/scss-group4/ScssMixins.vue +1 -1
- package/CssPreprocessor/Scss/components/scss-group5/ScssImporting.vue +7 -3
- package/CssPreprocessor/Scss/components/scss-group5/TextSettings.scss +8 -1
- package/CssPreprocessor/Stylus/App.vue +1 -1
- package/CssPreprocessor/Stylus/components/stylus-group1/StylusComments.vue +2 -2
- package/CssPreprocessor/Stylus/components/stylus-group1/StylusConditionals.vue +2 -2
- package/CssPreprocessor/Stylus/components/stylus-group1/StylusVariables.vue +7 -7
- package/CssPreprocessor/Stylus/components/stylus-group2/StylusIteration.vue +1 -1
- package/CssPreprocessor/Stylus/components/stylus-group2/StylusMethods.vue +3 -3
- package/CssPreprocessor/Stylus/components/stylus-group3/StylusExtends.vue +2 -2
- package/CssPreprocessor/Stylus/components/stylus-group3/StylusNesting.vue +5 -5
- package/CssPreprocessor/Stylus/components/stylus-group4/StylusKeyframes.vue +1 -1
- package/CssPreprocessor/Stylus/components/stylus-group4/StylusMaps.vue +1 -1
- package/CssPreprocessor/Stylus/components/stylus-group4/StylusMixins.vue +1 -1
- package/CssPreprocessor/Stylus/components/stylus-group5/StylusImporting.vue +7 -3
- package/CssPreprocessor/Stylus/components/stylus-group5/TextSettings.styl +8 -1
- package/CssPreprocessor/utils/ContentBlock.vue +5 -3
- package/CssPreprocessor/utils/FontStyle.css +1 -1
- package/CssPreprocessor/utils/Panel.vue +1 -1
- package/CssPreprocessor/utils/TitleBar.vue +4 -2
- package/DemoHomepage/App.vue +22 -19
- package/DemoHomepage/router.js +9 -0
- package/FilterDemo/AnimatePic.vue +6 -1
- package/FocusMoveStyle/App.vue +37 -46
- package/FocusMoveStyle/Item.vue +7 -17
- package/FocusMoveStyle/assets/redCircle.png +0 -0
- package/GiftRain/App.vue +52 -27
- package/GiftRain/components/RedPacket.vue +17 -15
- package/JsvRadarChart/App.vue +99 -0
- package/JsvRadarChart/assets/Square.png +0 -0
- package/JsvRadarChart/assets/resultSquare.png +0 -0
- package/MetroWidgetDemos/SkeletonDiagram/App.vue +78 -0
- package/MetroWidgetDemos/SkeletonDiagram/Item.vue +111 -0
- package/MetroWidgetDemos/SkeletonDiagram/assets/imageList.json +237 -0
- package/MetroWidgetDemos/SkeletonDiagram/data.js +16 -0
- package/MetroWidgetDemos/itemSizeUpdate/App.vue +51 -0
- package/MetroWidgetDemos/itemSizeUpdate/backward/Backward.vue +107 -0
- package/MetroWidgetDemos/itemSizeUpdate/backward/Item.vue +133 -0
- package/MetroWidgetDemos/itemSizeUpdate/center/Center.vue +106 -0
- package/MetroWidgetDemos/itemSizeUpdate/center/Item.vue +118 -0
- package/MetroWidgetDemos/ninePatchFocusPage/App.vue +105 -0
- package/MetroWidgetDemos/ninePatchFocusPage/Item.vue +69 -0
- package/MetroWidgetDemos/ninePatchFocusPage/PageRow.vue +89 -0
- package/MetroWidgetDemos/routeList.js +18 -5
- package/MetroWidgetDemos/slideSetting/App.vue +8 -8
- package/MockjsDemo/App.vue +54 -0
- package/MockjsDemo/KeyEventCatcher.vue +19 -0
- package/MockjsDemo/mock/index.js +12 -0
- package/NinePatchDemo/App.vue +2 -2
- package/NinePatchDemo/Item.vue +15 -5
- package/Preload/Item.vue +27 -10
- package/SprayView/App.vue +71 -63
- package/SprayView/assets/goldencoin1.png +0 -0
- package/SprayView/assets/goldencoin2.png +0 -0
- package/SprayView/assets/redpacket1.png +0 -0
- package/SprayView/assets/redpacket2.png +0 -0
- package/SprayView/assets/star1.png +0 -0
- package/SprayView/assets/star2.png +0 -0
- package/SprayView/assets/star3.png +0 -0
- package/SprayView/assets/star4.png +0 -0
- package/Swiper/App.vue +1 -1
- package/TextureAnimation/App2.vue +4 -2
- package/TouchSample/Item.vue +0 -1
- package/package.json +2 -1
- /package/{FocusMoveStyle/assets/focus.png → assets/focus1.png} +0 -0
|
@@ -43,7 +43,7 @@ import iconImgPath from "../../assets/icon.png";
|
|
|
43
43
|
left: 92,
|
|
44
44
|
width: 90,
|
|
45
45
|
height: 40,
|
|
46
|
-
backgroundImage: 'linear-gradient(rgba(255, 0, 0, 1.0), rgba(0,255,1.0))',
|
|
46
|
+
backgroundImage: 'linear-gradient(rgba(255, 0, 0, 1.0), rgba(0,255,0,1.0))',
|
|
47
47
|
}"
|
|
48
48
|
>
|
|
49
49
|
gradient
|
|
@@ -4,15 +4,24 @@ let timerId = -1;
|
|
|
4
4
|
let state = reactive({
|
|
5
5
|
foreColor: "#FF0000",
|
|
6
6
|
backColor: "#00FF00",
|
|
7
|
+
width:65,
|
|
8
|
+
transX: 0,
|
|
9
|
+
transY: 0,
|
|
7
10
|
});
|
|
8
11
|
onMounted(() => {
|
|
9
12
|
timerId = setInterval(() => {
|
|
10
13
|
if (state.foreColor == "#00FF00") {
|
|
11
14
|
state.foreColor = "#FF0000";
|
|
12
15
|
state.backColor = "#00FF00";
|
|
16
|
+
state.width = 65;
|
|
17
|
+
state.transX = 50;
|
|
18
|
+
state.transY = 0;
|
|
13
19
|
} else {
|
|
14
20
|
state.foreColor = "#00FF00";
|
|
15
21
|
state.backColor = "#FF0000";
|
|
22
|
+
state.width = 55;
|
|
23
|
+
state.transX = 0;
|
|
24
|
+
state.transY = 50;
|
|
16
25
|
}
|
|
17
26
|
}, 3000);
|
|
18
27
|
});
|
|
@@ -27,27 +36,36 @@ onBeforeUnmount(() => {
|
|
|
27
36
|
</script>
|
|
28
37
|
|
|
29
38
|
<template>
|
|
30
|
-
<div class="block"
|
|
39
|
+
<div class="block-var">CSS class中包含变量</div>
|
|
40
|
+
|
|
41
|
+
<div class="block-kf-var">CSS keyframes中包含变量</div>
|
|
31
42
|
|
|
32
|
-
<div
|
|
33
|
-
:style="{
|
|
34
|
-
left: 70,
|
|
35
|
-
width: 65,
|
|
36
|
-
height: 65,
|
|
37
|
-
color: state.foreColor,
|
|
38
|
-
backgroundColor: state.backColor,
|
|
39
|
-
}"
|
|
40
|
-
>
|
|
41
|
-
子级元素CSS class中包含变量
|
|
42
|
-
</div>
|
|
43
43
|
</template>
|
|
44
44
|
|
|
45
45
|
<style scoped>
|
|
46
|
-
.block {
|
|
46
|
+
.block-var {
|
|
47
|
+
width: v-bind('state.width + 10');
|
|
48
|
+
height: 65;
|
|
49
|
+
color: v-bind('state.foreColor');
|
|
50
|
+
background-color: v-bind('state.backColor');
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
.block-kf-var {
|
|
54
|
+
left: 100;
|
|
47
55
|
width: 65;
|
|
48
56
|
height: 65;
|
|
49
|
-
|
|
50
|
-
color: v-bind(state.
|
|
51
|
-
|
|
57
|
+
color: v-bind('state.foreColor');
|
|
58
|
+
background-color: v-bind('state.backColor');
|
|
59
|
+
animation: AnimTranslate 2s linear infinite;
|
|
52
60
|
}
|
|
61
|
+
|
|
62
|
+
@keyframes AnimTranslate {
|
|
63
|
+
from {
|
|
64
|
+
transform: translate3d(0, v-bind('state.transY'), 0);
|
|
65
|
+
}
|
|
66
|
+
to {
|
|
67
|
+
transform: translate3d(v-bind('state.transX'), 0, 0);
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
|
|
53
71
|
</style>
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
const getSearchQuery = (url = '', obj, paramPosition) => {
|
|
2
|
+
const [searchPart = '', hashPart = ''] = url.split('#');
|
|
3
|
+
// eslint-disable-next-line no-nested-ternary
|
|
4
|
+
const position = (paramPosition === undefined) ? ((searchPart || !hashPart) ? 0 : 1) : paramPosition;
|
|
5
|
+
const setPart = position === 0 ? searchPart : hashPart;
|
|
6
|
+
const [base = '', search = ''] = setPart.split('?');
|
|
7
|
+
const originParams = {};
|
|
8
|
+
const combine = (prefix, value) => (value ? `${prefix}${value}` : '');
|
|
9
|
+
const getSearch = (data = {}) => {
|
|
10
|
+
const result = [];
|
|
11
|
+
Object.keys(data).forEach((key) => {
|
|
12
|
+
const val = data[key];
|
|
13
|
+
if (val !== null && val !== undefined) {
|
|
14
|
+
result.push([key, encodeURIComponent(val)].join('='));
|
|
15
|
+
}
|
|
16
|
+
});
|
|
17
|
+
return combine('?', result.join('&'));
|
|
18
|
+
};
|
|
19
|
+
search
|
|
20
|
+
.split('&')
|
|
21
|
+
.filter((x) => x)
|
|
22
|
+
.forEach((keyvalue) => {
|
|
23
|
+
const [key = '', value = ''] = keyvalue.split('=');
|
|
24
|
+
originParams[key] = decodeURIComponent(value);
|
|
25
|
+
});
|
|
26
|
+
if (obj) {
|
|
27
|
+
// 赋值
|
|
28
|
+
Object.assign(originParams, obj);
|
|
29
|
+
switch (position) {
|
|
30
|
+
case 0:
|
|
31
|
+
// 参数在search部分,拼接方式为base+getSearch+hashPart
|
|
32
|
+
return `${base}${getSearch(originParams)}${combine('#', hashPart)}`;
|
|
33
|
+
case 1:
|
|
34
|
+
// 参数在hash部分,拼接方式为searchPart+ base+getSearch
|
|
35
|
+
return searchPart + combine('#', base + getSearch(originParams));
|
|
36
|
+
default:
|
|
37
|
+
break;
|
|
38
|
+
}
|
|
39
|
+
} else {
|
|
40
|
+
// 取值
|
|
41
|
+
return originParams;
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
export {getSearchQuery}
|
|
@@ -11,7 +11,7 @@ export default {
|
|
|
11
11
|
+ '.less-comments {\n'
|
|
12
12
|
+ ' // less 单行注释\n'
|
|
13
13
|
+ ' /* less 多行注释 */\n'
|
|
14
|
-
+ ' color: #
|
|
14
|
+
+ ' color: #126085;\n'
|
|
15
15
|
+ '}'}}
|
|
16
16
|
</div>
|
|
17
17
|
</div>
|
|
@@ -23,7 +23,7 @@ export default {
|
|
|
23
23
|
.less-comments {
|
|
24
24
|
// less 单行注释
|
|
25
25
|
/* less 多行注释 */
|
|
26
|
-
color: #
|
|
26
|
+
color: #126085;
|
|
27
27
|
font-size: 14;
|
|
28
28
|
|
|
29
29
|
left: 10;
|
|
@@ -10,7 +10,7 @@ export default {
|
|
|
10
10
|
+ '.less-conditional {\n'
|
|
11
11
|
+ ' color: if(@show-green,\n'
|
|
12
12
|
+ ' #00FF00,\n'
|
|
13
|
-
+ ' #
|
|
13
|
+
+ ' #126085);\n'
|
|
14
14
|
+ '}\n'}}
|
|
15
15
|
</div>
|
|
16
16
|
</div>
|
|
@@ -21,7 +21,7 @@ export default {
|
|
|
21
21
|
.less-conditional {
|
|
22
22
|
color: if(@show-green,
|
|
23
23
|
#00FF00,
|
|
24
|
-
#
|
|
24
|
+
#126085);
|
|
25
25
|
|
|
26
26
|
font-size: 14;
|
|
27
27
|
left: 10;
|
|
@@ -6,14 +6,14 @@ export default {
|
|
|
6
6
|
<template>
|
|
7
7
|
<div>
|
|
8
8
|
<div class="less-var-general">
|
|
9
|
-
{{'@my-color: #
|
|
9
|
+
{{'@my-color: #126085; // 一般变量\n'
|
|
10
10
|
+ '.less-var-general {\n'
|
|
11
11
|
+ ' color: @my-color;\n'
|
|
12
12
|
+ '}'}}
|
|
13
13
|
</div>
|
|
14
14
|
<div class="less-var-enclosing">
|
|
15
15
|
{{'.less-var-enclosing {\n'
|
|
16
|
-
+ ' @my-color: #
|
|
16
|
+
+ ' @my-color: #5a4ba4; // 局部变量\n'
|
|
17
17
|
+ ' color: @my-color;\n'
|
|
18
18
|
+ '}'}}
|
|
19
19
|
</div>
|
|
@@ -25,20 +25,20 @@ export default {
|
|
|
25
25
|
.less-var-general {
|
|
26
26
|
color: @my-color;
|
|
27
27
|
|
|
28
|
-
font-size:
|
|
28
|
+
font-size: 12;
|
|
29
29
|
left: 10;
|
|
30
30
|
top: 0;
|
|
31
31
|
width: 220;
|
|
32
32
|
height: 140;
|
|
33
33
|
}
|
|
34
34
|
|
|
35
|
-
@my-color: #
|
|
35
|
+
@my-color: #126085;
|
|
36
36
|
.less-var-enclosing {
|
|
37
37
|
// 只在 .less-enclosing 里有效,局部作用域
|
|
38
|
-
@my-color: #
|
|
38
|
+
@my-color: #5a4ba4; // 局部变量
|
|
39
39
|
color: @my-color;
|
|
40
40
|
|
|
41
|
-
font-size:
|
|
41
|
+
font-size: 12;
|
|
42
42
|
left: 10;
|
|
43
43
|
top: 68;
|
|
44
44
|
width: 220;
|
|
@@ -6,7 +6,7 @@ export default {
|
|
|
6
6
|
<template>
|
|
7
7
|
<div>
|
|
8
8
|
<div class="less-method-general">
|
|
9
|
-
{{'
|
|
9
|
+
{{'不支持函数,要用mixins替代'}}
|
|
10
10
|
</div>
|
|
11
11
|
</div>
|
|
12
12
|
</template>
|
|
@@ -18,7 +18,7 @@ export default {
|
|
|
18
18
|
.less-method-general {
|
|
19
19
|
.getsize(7);
|
|
20
20
|
|
|
21
|
-
color: #
|
|
21
|
+
color: #5a4ba4;
|
|
22
22
|
left: 10;
|
|
23
23
|
top: 10;
|
|
24
24
|
width: 240;
|
|
@@ -7,7 +7,7 @@ export default {
|
|
|
7
7
|
<div>
|
|
8
8
|
<div class="less-extend">
|
|
9
9
|
{{'.less-basic {\n'
|
|
10
|
-
+ ' color: #
|
|
10
|
+
+ ' color: #126085;\n'
|
|
11
11
|
+ '}\n'
|
|
12
12
|
+ '.less-extend :extend(.less-basic) {\n'
|
|
13
13
|
+ ' font-size: 14;\n'
|
|
@@ -18,7 +18,7 @@ export default {
|
|
|
18
18
|
|
|
19
19
|
<style scoped lang='less'>
|
|
20
20
|
.less-basic {
|
|
21
|
-
color: #
|
|
21
|
+
color: #126085;
|
|
22
22
|
}
|
|
23
23
|
|
|
24
24
|
.less-extend :extend(.less-basic) {
|
|
@@ -7,7 +7,7 @@ export default {
|
|
|
7
7
|
<div class="less-root">
|
|
8
8
|
<div class="less-rule-nesting">
|
|
9
9
|
{{'.less-root {\n'
|
|
10
|
-
+ ' color: #
|
|
10
|
+
+ ' color: #126085;\n'
|
|
11
11
|
+ ' .less-rule-nesting { // 规则嵌套\n'
|
|
12
12
|
+ ' font-size: 14;\n'
|
|
13
13
|
+ ' }\n'
|
|
@@ -19,7 +19,7 @@ export default {
|
|
|
19
19
|
</div>
|
|
20
20
|
<div class="less-root-parent-selector">
|
|
21
21
|
{{'.less-root {\n'
|
|
22
|
-
+ ' color: #
|
|
22
|
+
+ ' color: #126085;\n'
|
|
23
23
|
+ ' &-parent-selector { // 父选择器\n'
|
|
24
24
|
+ ' font-size: 14;\n'
|
|
25
25
|
+ ' }\n'
|
|
@@ -30,7 +30,7 @@ export default {
|
|
|
30
30
|
|
|
31
31
|
<style scoped lang='less'>
|
|
32
32
|
.less-root {
|
|
33
|
-
color: #
|
|
33
|
+
color: #126085;
|
|
34
34
|
|
|
35
35
|
.less-rule-nesting { // 规则嵌套
|
|
36
36
|
font-size: 14;
|
|
@@ -42,7 +42,7 @@ export default {
|
|
|
42
42
|
}
|
|
43
43
|
|
|
44
44
|
.less-prop-nesting { // 属性嵌套(不支持)
|
|
45
|
-
color: #
|
|
45
|
+
color: #5a4ba4;
|
|
46
46
|
font-size: 14;
|
|
47
47
|
|
|
48
48
|
left: 10;
|
|
@@ -16,9 +16,13 @@ export default {
|
|
|
16
16
|
+ 'TextSettings.less\n'
|
|
17
17
|
+ '\n'
|
|
18
18
|
+ '.less-imported {\n'
|
|
19
|
-
+ ' color: #
|
|
20
|
-
+ ' font-size: 14;\n'
|
|
21
|
-
|
|
19
|
+
+ ' color: #126085;\n'
|
|
20
|
+
+ ' font-size: 14;\n'}}
|
|
21
|
+
<div class="less-nesting">
|
|
22
|
+
{{' .less-nesting {\n'
|
|
23
|
+
+ ' color: #5149a1;\n'
|
|
24
|
+
+ ' }' }}
|
|
25
|
+
</div>
|
|
22
26
|
</div>
|
|
23
27
|
</div>
|
|
24
28
|
</template>
|
|
@@ -6,24 +6,25 @@ export default {
|
|
|
6
6
|
<template>
|
|
7
7
|
<div>
|
|
8
8
|
<div class="scss-comments">
|
|
9
|
-
{{'// scss
|
|
10
|
-
+ '/* scss
|
|
9
|
+
{{'// scss 单行写法样例\n'
|
|
10
|
+
+ '/* scss 多行写法样例 */\n'
|
|
11
11
|
+ '.scss-comments {\n'
|
|
12
|
-
+ ' // scss
|
|
13
|
-
+ ' /* scss
|
|
14
|
-
+ ' color: #
|
|
12
|
+
+ ' // scss 单行注释样例\n'
|
|
13
|
+
+ ' /* scss 多行注释样例 */\n'
|
|
14
|
+
+ ' color: #126085;\n'
|
|
15
15
|
+ '}'}}
|
|
16
16
|
</div>
|
|
17
17
|
</div>
|
|
18
18
|
</template>
|
|
19
19
|
|
|
20
20
|
<style scoped lang="scss">
|
|
21
|
-
// scss
|
|
22
|
-
/* scss
|
|
21
|
+
// scss 单行写法样例
|
|
22
|
+
/* scss 多行写法样例 */
|
|
23
23
|
.scss-comments {
|
|
24
|
-
// scss
|
|
25
|
-
/* scss
|
|
26
|
-
color: #
|
|
24
|
+
// scss 单行注释样例
|
|
25
|
+
/* scss 多行注释样例 */
|
|
26
|
+
// color: #3d73b2;
|
|
27
|
+
color:#126085;
|
|
27
28
|
font-size: 14;
|
|
28
29
|
|
|
29
30
|
left: 10;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
<script>
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
<script setup>
|
|
2
|
+
// TODO review: 撰写setTimeout + v-bind控制show-green颜色
|
|
3
|
+
// unmount去掉setTimeout
|
|
4
|
+
|
|
4
5
|
</script>
|
|
5
6
|
|
|
6
7
|
<template>
|
|
@@ -11,7 +12,7 @@ export default {
|
|
|
11
12
|
+ ' @if $show-green {\n'
|
|
12
13
|
+ ' color: #00FF00;\n'
|
|
13
14
|
+ ' } @else {\n'
|
|
14
|
-
+ ' color: #
|
|
15
|
+
+ ' color: #126085;\n'
|
|
15
16
|
+ ' }\n'
|
|
16
17
|
+ '}\n'}}
|
|
17
18
|
</div>
|
|
@@ -19,12 +20,13 @@ export default {
|
|
|
19
20
|
</template>
|
|
20
21
|
|
|
21
22
|
<style scoped lang="scss">
|
|
22
|
-
$show-green: false;
|
|
23
|
+
$show-green: false; /* 不支持在style里面声明的变量动态改变 */
|
|
23
24
|
.scss-conditional {
|
|
24
25
|
@if $show-green {
|
|
25
26
|
color: #00FF00;
|
|
26
27
|
} @else {
|
|
27
|
-
color: #
|
|
28
|
+
// color: #7b78a8;
|
|
29
|
+
color:#126085
|
|
28
30
|
}
|
|
29
31
|
|
|
30
32
|
font-size: 14;
|
|
@@ -6,14 +6,14 @@ export default {
|
|
|
6
6
|
<template>
|
|
7
7
|
<div>
|
|
8
8
|
<div class="scss-var-general">
|
|
9
|
-
{{'$my-color: #
|
|
9
|
+
{{'$my-color: #126085; // 一般变量\n'
|
|
10
10
|
+ '.scss-var-general {\n'
|
|
11
11
|
+ ' color: $my-color;\n'
|
|
12
12
|
+ '}'}}
|
|
13
13
|
</div>
|
|
14
14
|
<div class="scss-var-enclosing">
|
|
15
15
|
{{'.scss-var-enclosing {\n'
|
|
16
|
-
+ ' $my-color: #
|
|
16
|
+
+ ' $my-color: #5a4ba4; // 局部变量\n'
|
|
17
17
|
+ ' color: $my-color;\n'
|
|
18
18
|
+ '}'}}
|
|
19
19
|
</div>
|
|
@@ -21,7 +21,8 @@ export default {
|
|
|
21
21
|
</template>
|
|
22
22
|
|
|
23
23
|
<style scoped lang="scss">
|
|
24
|
-
$my-color: #
|
|
24
|
+
$my-color: #0F0F00; // 一般变量
|
|
25
|
+
$my-color: #126085; // 变量改值
|
|
25
26
|
.scss-var-general {
|
|
26
27
|
color: $my-color;
|
|
27
28
|
|
|
@@ -32,13 +33,12 @@ $my-color: #00FF00; // 一般变量
|
|
|
32
33
|
height: 140;
|
|
33
34
|
}
|
|
34
35
|
|
|
35
|
-
$my-color: #00FF00;
|
|
36
36
|
.scss-var-enclosing {
|
|
37
37
|
// 只在 .scss-enclosing 里有效,局部作用域
|
|
38
|
-
$my-color: #
|
|
38
|
+
$my-color: #5a4ba4; // 局部变量
|
|
39
39
|
color: $my-color;
|
|
40
40
|
|
|
41
|
-
font-size:
|
|
41
|
+
font-size: 13;
|
|
42
42
|
left: 10;
|
|
43
43
|
top: 68;
|
|
44
44
|
width: 220;
|
|
@@ -19,7 +19,7 @@ export default {
|
|
|
19
19
|
</template>
|
|
20
20
|
|
|
21
21
|
<style scoped lang="scss">
|
|
22
|
-
$size:
|
|
22
|
+
$size: 3;
|
|
23
23
|
@for $num from 1 through 4 {
|
|
24
24
|
$size : $size + $num
|
|
25
25
|
}
|
|
@@ -27,7 +27,7 @@ $size: 4;
|
|
|
27
27
|
.scss-iteration {
|
|
28
28
|
font-size: $size;
|
|
29
29
|
|
|
30
|
-
color: #
|
|
30
|
+
color: #126085;
|
|
31
31
|
left: 10;
|
|
32
32
|
top: 3;
|
|
33
33
|
width: 230;
|
|
@@ -10,7 +10,7 @@ export default {
|
|
|
10
10
|
+ ' @return 2 * $zoom\n'
|
|
11
11
|
+ '}\n'
|
|
12
12
|
+ '.scss-method-general {\n'
|
|
13
|
-
+ ' font-size: getsize(
|
|
13
|
+
+ ' font-size: getsize(6.5);\n'
|
|
14
14
|
+ '}'}}
|
|
15
15
|
</div>
|
|
16
16
|
|
|
@@ -19,7 +19,7 @@ export default {
|
|
|
19
19
|
+ ' @return 2 * $zoom\n'
|
|
20
20
|
+ '}\n'
|
|
21
21
|
+ '.scss-method-named {\n'
|
|
22
|
-
+ ' font-size: getsize($zoom:
|
|
22
|
+
+ ' font-size: getsize($zoom: 6.5);\n'
|
|
23
23
|
+ '}'}}
|
|
24
24
|
</div>
|
|
25
25
|
|
|
@@ -32,7 +32,7 @@ export default {
|
|
|
32
32
|
+ ' @return $size\n'
|
|
33
33
|
+ '}\n'
|
|
34
34
|
+ '.scss-method-varargs {\n'
|
|
35
|
-
+ ' font-size: getsize(
|
|
35
|
+
+ ' font-size: getsize(6, 1);\n'
|
|
36
36
|
+ '}'}}
|
|
37
37
|
</div>
|
|
38
38
|
</div>
|
|
@@ -43,9 +43,9 @@ export default {
|
|
|
43
43
|
@return 2 * $zoom
|
|
44
44
|
}
|
|
45
45
|
.scss-method-general {
|
|
46
|
-
font-size: getsize(
|
|
46
|
+
font-size: getsize(6.5);
|
|
47
47
|
|
|
48
|
-
color: #
|
|
48
|
+
color: #126085;
|
|
49
49
|
left: 10;
|
|
50
50
|
top: 10;
|
|
51
51
|
width: 240;
|
|
@@ -56,9 +56,9 @@ export default {
|
|
|
56
56
|
@return 2 * $zoom
|
|
57
57
|
}
|
|
58
58
|
.scss-method-named {
|
|
59
|
-
font-size: getsize($zoom:
|
|
59
|
+
font-size: getsize($zoom: 6.5);
|
|
60
60
|
|
|
61
|
-
color
|
|
61
|
+
color:#126085;
|
|
62
62
|
left: 10;
|
|
63
63
|
top: 140;
|
|
64
64
|
width: 240;
|
|
@@ -73,9 +73,9 @@ export default {
|
|
|
73
73
|
@return $size
|
|
74
74
|
}
|
|
75
75
|
.scss-method-varargs {
|
|
76
|
-
font-size: getsize(
|
|
76
|
+
font-size: getsize(6, 1);
|
|
77
77
|
|
|
78
|
-
color: #
|
|
78
|
+
color: #126085;
|
|
79
79
|
left: 10;
|
|
80
80
|
top: 270;
|
|
81
81
|
width: 240;
|
|
@@ -7,7 +7,7 @@ export default {
|
|
|
7
7
|
<div>
|
|
8
8
|
<div class="scss-extend">
|
|
9
9
|
{{'.scss-basic {\n'
|
|
10
|
-
+ ' color: #
|
|
10
|
+
+ ' color: #126085;\n'
|
|
11
11
|
+ '}\n'
|
|
12
12
|
+ '.scss-extend {\n'
|
|
13
13
|
+ ' @extend .scss-basic;\n'
|
|
@@ -19,7 +19,7 @@ export default {
|
|
|
19
19
|
|
|
20
20
|
<style scoped lang='scss'>
|
|
21
21
|
.scss-basic {
|
|
22
|
-
color: #
|
|
22
|
+
color: #126085;
|
|
23
23
|
}
|
|
24
24
|
|
|
25
25
|
.scss-extend {
|
|
@@ -7,7 +7,7 @@ export default {
|
|
|
7
7
|
<div class="scss-root">
|
|
8
8
|
<div class="scss-rule-nesting">
|
|
9
9
|
{{'.scss-root {\n'
|
|
10
|
-
+ ' color: #
|
|
10
|
+
+ ' color: #126085;\n'
|
|
11
11
|
+ ' .scss-rule-nesting { // 规则嵌套\n'
|
|
12
12
|
+ ' font-size: 14;\n'
|
|
13
13
|
+ ' }\n'
|
|
@@ -26,7 +26,7 @@ export default {
|
|
|
26
26
|
</div>
|
|
27
27
|
<div class="scss-root-parent-selector">
|
|
28
28
|
{{'.scss-root {\n'
|
|
29
|
-
+ ' color: #
|
|
29
|
+
+ ' color: #126085;\n'
|
|
30
30
|
+ ' &-parent-selector { // 父选择器\n'
|
|
31
31
|
+ ' font-size: 14;\n'
|
|
32
32
|
+ ' }\n'
|
|
@@ -37,7 +37,7 @@ export default {
|
|
|
37
37
|
|
|
38
38
|
<style scoped lang='scss'>
|
|
39
39
|
.scss-root {
|
|
40
|
-
color: #
|
|
40
|
+
color: #126085;
|
|
41
41
|
|
|
42
42
|
.scss-rule-nesting { // 规则嵌套
|
|
43
43
|
font-size: 14;
|