diff --git a/src/.vuepress/config.js b/src/.vuepress/config.js index 46b39821cb..ea9e6d5bdf 100644 --- a/src/.vuepress/config.js +++ b/src/.vuepress/config.js @@ -94,6 +94,7 @@ const sidebar = { 'migration/functional-components', 'migration/async-components', 'migration/custom-directives', + 'migration/filters', 'migration/fragments', 'migration/render-function-api', 'migration/slots-unification', diff --git a/src/.vuepress/styles/index.styl b/src/.vuepress/styles/index.styl index fd40ef0fd5..1ed44dd2bd 100644 --- a/src/.vuepress/styles/index.styl +++ b/src/.vuepress/styles/index.styl @@ -156,3 +156,13 @@ font-weight: bold; opacity: 1!important; } + +.badge { + background-color: #b00000; + font-size: 0.8rem; + border: 2px solid #b00000; + border-radius: 5px; + margin-right: 0.5rem; + color: #fff; + padding: 0.25rem 0.25rem; +} diff --git a/src/.vuepress/theme/styles/index.styl b/src/.vuepress/theme/styles/index.styl index e3940e582d..b63f1b4093 100644 --- a/src/.vuepress/theme/styles/index.styl +++ b/src/.vuepress/theme/styles/index.styl @@ -119,12 +119,17 @@ h1, h2, h3, h4, h5, h6 margin-bottom 0 &:first-child + display flex + align-items center margin-top -1.5rem margin-bottom 1rem + p, + pre, + .custom-block margin-top 2rem + .badge:first-of-type + margin-left 0.5rem + &:hover .header-anchor opacity: 1 diff --git a/src/guide/migration/filters.md b/src/guide/migration/filters.md new file mode 100644 index 0000000000..4f294ecad2 --- /dev/null +++ b/src/guide/migration/filters.md @@ -0,0 +1,75 @@ +--- +types: + - removed + - breaking +--- + +# Filters {{ type }} + +## Overview + +Filters are removed from Vue 3.0 and no longer be supported. + +## 2.x Syntax + +In 2.x, developers could use filters in order to apply common text formatting. + +For example: + +```html + + + +``` + +While this seems like a convenience, it requires a custom syntax that breaks the assumption of expressions inside of curly braces being "just JavaScript," which has both learning and implementation costs. + +## 3.x Update + +In 3.x, filters are removed and no longer supported. Instead, we recommend replacing with method calls or computed properties instead. + +Using the example above, here is one example of how it could be implemented. + +```html + + + +``` + +## How to Migrate + +Instead of using filters, we recommend replacing them with computed properties or methods.