Skip to content

Commit

Permalink
feat: expose vetur helpers (#195)
Browse files Browse the repository at this point in the history
  • Loading branch information
reslear authored Apr 6, 2021
1 parent 1343eaa commit 543e7cf
Show file tree
Hide file tree
Showing 3 changed files with 70 additions and 1 deletion.
7 changes: 6 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,13 @@
"main": "dist/module.js",
"types": "dist/types.d.ts",
"files": [
"dist"
"dist",
"vetur"
],
"vetur": {
"tags": "vetur/tags.json",
"attributes": "vetur/attributes.json"
},
"scripts": {
"build": "siroc build && mkdist --src src/runtime --dist dist/runtime",
"dev": "yarn nuxt playground",
Expand Down
32 changes: 32 additions & 0 deletions vetur/attributes.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
{
"src":{
"description":"Path to image file"
},
"width":{
"description":"Specify width of the image."
},
"height":{
"description":"Specify height of the image."
},
"sizes":{
"description":"Specify responsive reiszes. `sm:100vw md:50vw lg:400px`"
},
"provider":{
"description":"Use other provider instead of default provider option specified in nuxt.config`"
},
"preset":{
"description":"Presets are predefined sets of image modifiers that can be used create unified form of images in your projects."
},
"format":{
"description":"In case you want to serve images in a specific format, use this prop. `webp`, `jpeg`, `jpg`, `png`, `gif` and `svg`"
},
"quality":{
"description":"The quality for the generated image(s)."
},
"fit":{
"description":"The fit property specifies the size of the images. There are five standard values you can use with this property. `cover` `contain` `fill` `inside` `outside`"
},
"modifiers":{
"description":"In addition to standard modifiers, every provider can have their own modifiers. `:modifiers=\"{ roundCorner: '0:100' }\"`"
}
}
32 changes: 32 additions & 0 deletions vetur/tags.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
{
"nuxt-picture":{
"attributes":[
"src",
"width",
"height",
"sizes",
"provider",
"preset",
"format",
"quality",
"fit",
"modifiers"
],
"description":"drop-in replacement for the native `<picture>` tag"
},
"nuxt-img":{
"attributes":[
"src",
"width",
"height",
"sizes",
"provider",
"preset",
"format",
"quality",
"fit",
"modifiers"
],
"description":"drop-in replacement for the native `<img>` tag"
}
}

0 comments on commit 543e7cf

Please sign in to comment.