style.ts — vue Source File
Architecture documentation for style.ts, a typescript file in the vue codebase. 4 imports, 1 dependents.
Entity Profile
Dependency Diagram
graph LR 9dbe442c_e2c5_ea25_270d_00a343abbe1a["style.ts"] 58dc275a_2d47_31bd_c15f_4e8cccfdf792["text-parser"] 9dbe442c_e2c5_ea25_270d_00a343abbe1a --> 58dc275a_2d47_31bd_c15f_4e8cccfdf792 40b0afbe_a3c8_9769_c890_cf9c2266939c["style"] 9dbe442c_e2c5_ea25_270d_00a343abbe1a --> 40b0afbe_a3c8_9769_c890_cf9c2266939c a0ba3d1b_5fa2_9aa0_10cf_68e933ca762a["helpers"] 9dbe442c_e2c5_ea25_270d_00a343abbe1a --> a0ba3d1b_5fa2_9aa0_10cf_68e933ca762a 47ae9f26_59d1_fab2_349f_966f5d15495a["compiler"] 9dbe442c_e2c5_ea25_270d_00a343abbe1a --> 47ae9f26_59d1_fab2_349f_966f5d15495a 7a870aa6_cb8c_14d5_7123_6cc7f7056936["index.ts"] 7a870aa6_cb8c_14d5_7123_6cc7f7056936 --> 9dbe442c_e2c5_ea25_270d_00a343abbe1a style 9dbe442c_e2c5_ea25_270d_00a343abbe1a fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
import { parseText } from 'compiler/parser/text-parser'
import { parseStyleText } from 'web/util/style'
import { getAndRemoveAttr, getBindingAttr, baseWarn } from 'compiler/helpers'
import { ASTElement, CompilerOptions, ModuleOptions } from 'types/compiler'
function transformNode(el: ASTElement, options: CompilerOptions) {
const warn = options.warn || baseWarn
const staticStyle = getAndRemoveAttr(el, 'style')
if (staticStyle) {
/* istanbul ignore if */
if (__DEV__) {
const res = parseText(staticStyle, options.delimiters)
if (res) {
warn(
`style="${staticStyle}": ` +
'Interpolation inside attributes has been removed. ' +
'Use v-bind or the colon shorthand instead. For example, ' +
'instead of <div style="{{ val }}">, use <div :style="val">.',
el.rawAttrsMap['style']
)
}
}
el.staticStyle = JSON.stringify(parseStyleText(staticStyle))
}
const styleBinding = getBindingAttr(el, 'style', false /* getStatic */)
if (styleBinding) {
el.styleBinding = styleBinding
}
}
function genData(el: ASTElement): string {
let data = ''
if (el.staticStyle) {
data += `staticStyle:${el.staticStyle},`
}
if (el.styleBinding) {
data += `style:(${el.styleBinding}),`
}
return data
}
export default {
staticKeys: ['staticStyle'],
transformNode,
genData
} as ModuleOptions
Domain
Subdomains
Functions
Dependencies
- compiler
- helpers
- style
- text-parser
Imported By
Source
Frequently Asked Questions
What does style.ts do?
style.ts is a source file in the vue codebase, written in typescript. It belongs to the WebPlatform domain, WebCompiler subdomain.
What functions are defined in style.ts?
style.ts defines 2 function(s): genData, transformNode.
What does style.ts depend on?
style.ts imports 4 module(s): compiler, helpers, style, text-parser.
What files import style.ts?
style.ts is imported by 1 file(s): index.ts.
Where is style.ts in the architecture?
style.ts is located at src/platforms/web/compiler/modules/style.ts (domain: WebPlatform, subdomain: WebCompiler, directory: src/platforms/web/compiler/modules).
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free