ok-jose / blog Goto Github PK
View Code? Open in Web Editor NEWblog code
blog code
最近在写TS项目时,导入json文件时,vscode一直报这个错误:
[ts] Cannot find module './cities.json'. Consider using '--resolveJsonModule' to import module with '.json' extension
然后晚上找了找解决方案:
json
模块:declare module '*.json' { const value: any export default value }
然后就可以正常使用了: import cities from './cities.json'
attr() 官方解释
The attr() CSS function is used to retrieve the value of an attribute of the selected element and use it in the style sheet. It can also be used on pseudo-elements, in which case the value of the attribute on the pseudo-element's originating element is returned.
翻译过来就是:
CSS表达式 attr() 用来获取选择到的元素的某一HTML属性值,并用于其样式。它也可以用于伪元素,属性值采用伪元素所依附的元素。
attr() 表达式可以用于任何CSS属性。
因此我们可以在我们可以把一些样式属性与页面上可变量结合在一起,少了些class判断。
<div class=",mul-source" data-shopnow="SHOP NOW"></div>
.mul-source:after { display: block; content: attr(data-shopnow); position: absolute; }
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.