style.spec.ts — vue Source File
Architecture documentation for style.spec.ts, a typescript file in the vue codebase. 1 imports, 0 dependents.
Entity Profile
Dependency Diagram
graph LR e4fbec66_7f2c_f6a4_7903_e067c8cde67b["style.spec.ts"] db9e7bef_009d_3918_6e7d_543a36a38d75["vue"] e4fbec66_7f2c_f6a4_7903_e067c8cde67b --> db9e7bef_009d_3918_6e7d_543a36a38d75 style e4fbec66_7f2c_f6a4_7903_e067c8cde67b fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
import Vue from 'vue'
function checkPrefixedProp(prop) {
const el = document.createElement('div')
const upper = prop.charAt(0).toUpperCase() + prop.slice(1)
if (!(prop in el.style)) {
const prefixes = ['Webkit', 'Moz', 'ms']
let i = prefixes.length
while (i--) {
if (prefixes[i] + upper in el.style) {
prop = prefixes[i] + upper
}
}
}
return prop
}
describe('Directive v-bind:style', () => {
let vm
beforeEach(() => {
vm = new Vue({
template: '<div :style="styles"></div>',
data() {
return {
styles: {},
fontSize: 16
}
}
}).$mount()
})
it('string', done => {
vm.styles = 'color:red;'
waitForUpdate(() => {
expect(vm.$el.style.cssText.replace(/\s/g, '')).toBe('color:red;')
}).then(done)
})
it('falsy number', done => {
vm.styles = { opacity: 0 }
waitForUpdate(() => {
expect(vm.$el.style.opacity).toBe('0')
}).then(done)
})
it('plain object', done => {
vm.styles = { color: 'red' }
waitForUpdate(() => {
expect(vm.$el.style.cssText.replace(/\s/g, '')).toBe('color:red;')
}).then(done)
})
it('camelCase', done => {
vm.styles = { marginRight: '10px' }
waitForUpdate(() => {
expect(vm.$el.style.marginRight).toBe('10px')
}).then(done)
})
// ... (355 more lines)
Domain
Subdomains
Functions
Dependencies
- vue
Source
Frequently Asked Questions
What does style.spec.ts do?
style.spec.ts is a source file in the vue codebase, written in typescript. It belongs to the VueCore domain, Instance subdomain.
What functions are defined in style.spec.ts?
style.spec.ts defines 1 function(s): checkPrefixedProp.
What does style.spec.ts depend on?
style.spec.ts imports 1 module(s): vue.
Where is style.spec.ts in the architecture?
style.spec.ts is located at test/unit/features/directives/style.spec.ts (domain: VueCore, subdomain: Instance, directory: test/unit/features/directives).
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free