-
-
Notifications
You must be signed in to change notification settings - Fork 155
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: support generated JS imports for external scoped style (#196)
Co-authored-by: Haoqun Jiang <[email protected]>
- Loading branch information
1 parent
5b2f9c8
commit bd5055d
Showing
11 changed files
with
236 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
import { | ||
Fragment as _Fragment, | ||
createElementBlock as _createElementBlock, | ||
createElementVNode as _createElementVNode, | ||
normalizeClass as _normalizeClass, | ||
openBlock as _openBlock, | ||
} from 'vue' | ||
|
||
import style0 from './external.module.css?module=true&lang.module.css' | ||
|
||
const __sfc__ = { | ||
data() { | ||
return { | ||
isRed: true, | ||
} | ||
}, | ||
} | ||
|
||
function render(_ctx, _cache, $props, $setup, $data, $options) { | ||
return ( | ||
_openBlock(), | ||
_createElementBlock( | ||
_Fragment, | ||
null, | ||
[ | ||
_createElementVNode( | ||
'p', | ||
{ | ||
class: _normalizeClass({ | ||
[_ctx.$style.red]: $data.isRed, | ||
'pre-compiled-external-cssmodules': true, | ||
}), | ||
}, | ||
' Am I red? ', | ||
2 /* CLASS */, | ||
), | ||
_createElementVNode( | ||
'p', | ||
{ | ||
class: _normalizeClass([ | ||
_ctx.$style.red, | ||
_ctx.$style.bold, | ||
'pre-compiled-external-cssmodules', | ||
]), | ||
}, | ||
' Red and bold ', | ||
2 /* CLASS */, | ||
), | ||
], | ||
64 /* STABLE_FRAGMENT */, | ||
) | ||
) | ||
} | ||
__sfc__.render = render | ||
const cssModules = {} | ||
cssModules['$style'] = style0 | ||
__sfc__.__cssModules = cssModules | ||
__sfc__.__file = 'external-cssmodules.vue' | ||
export default __sfc__ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
import './external.css?vue&type=style&scoped=true&id=0d49ede6&src=0d49ede6&lang.css' | ||
|
||
import { | ||
Fragment as _Fragment, | ||
createElementBlock as _createElementBlock, | ||
createElementVNode as _createElementVNode, | ||
openBlock as _openBlock, | ||
popScopeId as _popScopeId, | ||
pushScopeId as _pushScopeId, | ||
toDisplayString as _toDisplayString, | ||
vModelText as _vModelText, | ||
withDirectives as _withDirectives, | ||
ref, | ||
} from 'vue' | ||
const __sfc__ = { | ||
setup() { | ||
const msg = ref('Hello World!') | ||
return { msg } | ||
}, | ||
} | ||
|
||
const _withScopeId = (n) => ( | ||
_pushScopeId('data-v-0d49ede6'), (n = n()), _popScopeId(), n | ||
) | ||
const _hoisted_1 = { class: 'pre-compiled-external-scoped-title' } | ||
|
||
function render(_ctx, _cache, $props, $setup, $data, $options) { | ||
return ( | ||
_openBlock(), | ||
_createElementBlock( | ||
_Fragment, | ||
null, | ||
[ | ||
_createElementVNode( | ||
'h6', | ||
_hoisted_1, | ||
_toDisplayString($setup.msg), | ||
1 /* TEXT */, | ||
), | ||
_withDirectives( | ||
_createElementVNode( | ||
'input', | ||
{ | ||
'onUpdate:modelValue': | ||
_cache[0] || (_cache[0] = ($event) => ($setup.msg = $event)), | ||
}, | ||
null, | ||
512 /* NEED_PATCH */, | ||
), | ||
[[_vModelText, $setup.msg]], | ||
), | ||
], | ||
64 /* STABLE_FRAGMENT */, | ||
) | ||
) | ||
} | ||
__sfc__.render = render | ||
|
||
__sfc__.__scopeId = 'data-v-0d49ede6' | ||
__sfc__.__file = 'external-scoped.vue' | ||
export default __sfc__ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
.pre-compiled-external-scoped-title { | ||
color: red; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
.red { | ||
color: red; | ||
} | ||
.bold { | ||
font-weight: bold; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
import './foo.vue__0.css' | ||
|
||
import { | ||
Fragment as _Fragment, | ||
createElementBlock as _createElementBlock, | ||
createElementVNode as _createElementVNode, | ||
openBlock as _openBlock, | ||
toDisplayString as _toDisplayString, | ||
vModelText as _vModelText, | ||
withDirectives as _withDirectives, | ||
ref, | ||
} from 'vue' | ||
const __sfc__ = { | ||
setup() { | ||
const msg = ref('Hello World!') | ||
return { msg } | ||
}, | ||
} | ||
|
||
const _hoisted_1 = { class: 'pre-compiled-title' } | ||
|
||
function render(_ctx, _cache, $props, $setup, $data, $options) { | ||
return ( | ||
_openBlock(), | ||
_createElementBlock( | ||
_Fragment, | ||
null, | ||
[ | ||
_createElementVNode( | ||
'h6', | ||
_hoisted_1, | ||
_toDisplayString($setup.msg), | ||
1 /* TEXT */, | ||
), | ||
_withDirectives( | ||
_createElementVNode( | ||
'input', | ||
{ | ||
'onUpdate:modelValue': | ||
_cache[0] || (_cache[0] = ($event) => ($setup.msg = $event)), | ||
}, | ||
null, | ||
512 /* NEED_PATCH */, | ||
), | ||
[[_vModelText, $setup.msg]], | ||
), | ||
], | ||
64 /* STABLE_FRAGMENT */, | ||
) | ||
) | ||
} | ||
__sfc__.render = render | ||
|
||
__sfc__.__file = 'foo.vue' | ||
export default __sfc__ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
.pre-compiled-title { | ||
color: red; | ||
} |