We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
useCssModule
1 parent fc0e824 commit f56ba84Copy full SHA for f56ba84
test/apis/useCssModule.spec.js
@@ -0,0 +1,31 @@
1
+const Vue = require('vue/dist/vue.common.js')
2
+const { useCSSModule } = require('../../src')
3
+
4
+const style = { whateverStyle: 'whateverStyle' }
5
6
+function injectStyles() {
7
+ Object.defineProperty(this, '$style', {
8
+ configurable: true,
9
+ get: function () {
10
+ return style
11
+ },
12
+ })
13
+}
14
15
+describe('api/useCssModule', () => {
16
+ it('should get the same object', (done) => {
17
+ const vm = new Vue({
18
+ beforeCreate() {
19
+ injectStyles.call(this)
20
21
+ template: '<div>{{style}}</div>',
22
+ setup() {
23
+ const style = useCSSModule()
24
+ return { style }
25
26
27
+ vm.$mount()
28
+ expect(vm.style).toBe(style)
29
+ done()
30
31
+})
0 commit comments