博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
如何安装svelte_Svelte中的React性陈述
阅读量:2504 次
发布时间:2019-05-11

本文共 831 字,大约阅读时间需要 2 分钟。

如何安装svelte

In Svelte you can listen for changes in the component state, and update other variables.

在Svelte中,您可以侦听组件状态的变化,并更新其他变量。

For example if you have a count variable:

例如,如果您有一个count变量:

and you update it by clicking a button:

然后您通过单击按钮进行更新:

{count} 

You can listen for changes on count using the special syntax $: which defines a new block that Svelte will re-run when any variable referenced into it changes.

您可以使用特殊语法$:监听count变化$:它定义了一个新块,当其中引用的任何变量发生变化时,Svelte都会重新运行。

Here’s an example:

这是一个例子:

{count} 

I used the block:

我用了块:

$: console.log(`${count}`)

You can write more than one of them:

您可以编写其中一个以上的代码:

And you can also add a block to group more than one statement:

您还可以添加一个块来组合多个语句:

I used a console.log() call in there, but you can update other variables too:

我在那里使用了console.log()调用,但是您也可以更新其他变量:

翻译自:

如何安装svelte

转载地址:http://kvqgb.baihongyu.com/

你可能感兴趣的文章
Python性能鸡汤
查看>>
android Manifest.xml选项
查看>>
Cookie/Session机制具体解释
查看>>
ATMEGA16 IOport相关汇总
查看>>
有意思的cmd命令
查看>>
js正則表達式语法
查看>>
JVM-垃圾回收
查看>>
VS2013 添加已有文件夹
查看>>
python 计时程序运行时间
查看>>
【Shell脚本学习4】几种常见的Shell
查看>>
Git学习系列-Git基本概念
查看>>
c#多个程序集使用app.config 的解决办法
查看>>
模仿网站登录注册
查看>>
Linux+Apache+PHP+MySQL服务器环境配置(CentOS篇)
查看>>
Linux下获取本机IP地址的代码
查看>>
(C#)调用Webservice,提示远程服务器返回错误(500)内部服务器错误
查看>>
flex布局
查看>>
python-----python的文件操作
查看>>
java Graphics2d消除锯齿,使字体平滑显示
查看>>
控件中添加的成员变量value和control的区别
查看>>