File tree Expand file tree Collapse file tree 1 file changed +6
-6
lines changed Expand file tree Collapse file tree 1 file changed +6
-6
lines changed Original file line number Diff line number Diff line change 164
164
)
165
165
```
166
166
167
- ## Complete Example
167
+ ## Exemplo completo
168
168
169
- With this knowledge, we can now finish the component we started :
169
+ Com este conhecimento, podemos agora finalizar o componente que começamos :
170
170
171
171
``` js
172
172
const app = Vue .createApp ({})
173
173
174
- /** Recursively get text from children nodes */
174
+ /** Recupera o texto dos nós filhos recursivamente */
175
175
function getChildrenTextContent (children ) {
176
176
return children
177
177
.map (node => {
@@ -186,11 +186,11 @@ function getChildrenTextContent(children) {
186
186
187
187
app .component (' anchored-heading' , {
188
188
render () {
189
- // create kebab-case id from the text contents of the children
189
+ // cria um id em kebab-case a partir do texto dos filhos
190
190
const headingId = getChildrenTextContent (this .$slots .default ())
191
191
.toLowerCase ()
192
- .replace (/ \W + / g , ' -' ) // replace non-word characters with dash
193
- .replace (/ (^ -| -$ )/ g , ' ' ) // remove leading and trailing dashes
192
+ .replace (/ \W + / g , ' -' ) // substitui caracteres não-texto por traços
193
+ .replace (/ (^ -| -$ )/ g , ' ' ) // remove os traços iniciais e finais
194
194
195
195
return Vue .h (' h' + this .level , [
196
196
Vue .h (
You can’t perform that action at this time.
0 commit comments