@thinkpixellab-public/px-vue 3.0.86 → 3.0.87
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.
|
@@ -2,8 +2,9 @@
|
|
|
2
2
|
Automatically computes line clamp based on the available height and current line height.
|
|
3
3
|
-->
|
|
4
4
|
<template>
|
|
5
|
-
<component :is="tag" :class="bem()"
|
|
5
|
+
<component :is="tag" :class="bem()">
|
|
6
6
|
<span
|
|
7
|
+
v-if="enabled"
|
|
7
8
|
:class="bem('clamp')"
|
|
8
9
|
:style="{
|
|
9
10
|
'-webkit-line-clamp': lineCount,
|
|
@@ -15,6 +16,11 @@
|
|
|
15
16
|
{{ text }}
|
|
16
17
|
</slot>
|
|
17
18
|
</span>
|
|
19
|
+
<span v-else>
|
|
20
|
+
<slot>
|
|
21
|
+
{{ text }}
|
|
22
|
+
</slot>
|
|
23
|
+
</span>
|
|
18
24
|
</component>
|
|
19
25
|
</template>
|
|
20
26
|
|
|
@@ -25,6 +31,7 @@ export default {
|
|
|
25
31
|
name: 'px-auto-clamp',
|
|
26
32
|
mixins: [PxBaseResize],
|
|
27
33
|
props: {
|
|
34
|
+
enabled: { type: Boolean, default: true },
|
|
28
35
|
text: { type: String, default: null },
|
|
29
36
|
tag: { type: String, default: 'div' },
|
|
30
37
|
},
|
|
@@ -17,11 +17,7 @@ export default {
|
|
|
17
17
|
return this.mediaQuery.currentBreakpoint;
|
|
18
18
|
},
|
|
19
19
|
},
|
|
20
|
-
|
|
21
|
-
// setTimeout(() => {
|
|
22
|
-
// console.log(this.mediaQuery.breakpoints);
|
|
23
|
-
// }, 100);
|
|
24
|
-
},
|
|
20
|
+
|
|
25
21
|
methods: {
|
|
26
22
|
isBreakpointOrSmaller(breakpoint) {
|
|
27
23
|
if (this.currentBreakpoint === null) {
|
|
@@ -18,7 +18,7 @@ export default {
|
|
|
18
18
|
variantValue() {
|
|
19
19
|
return (
|
|
20
20
|
(this.variantBase ? `${this.variantBase} ` : '') +
|
|
21
|
-
(this.variant !== 'default' ? this.variant : this.variantDefault)
|
|
21
|
+
(this.variant && this.variant !== 'default' ? this.variant : this.variantDefault)
|
|
22
22
|
);
|
|
23
23
|
},
|
|
24
24
|
},
|
package/package.json
CHANGED
package/utils/bem.js
CHANGED
|
@@ -32,7 +32,8 @@ function hyphenate(str, shouldHyphenate = true) {
|
|
|
32
32
|
// Get block name
|
|
33
33
|
function getBlockName(component) {
|
|
34
34
|
if (!component.$options._blockName) {
|
|
35
|
-
let block = component
|
|
35
|
+
let block = 'bemBlockName' in component && component.bemBlockName();
|
|
36
|
+
block = block || component.$options.name || component.$options._componentTag;
|
|
36
37
|
if (block && block.indexOf('/') > -1) {
|
|
37
38
|
block = block.split('/').pop().split('.')[0];
|
|
38
39
|
}
|