Comments (13)
mark
from blog.
mark
from blog.
vm.$compile在目前的版本中已经弃用了吧。
from blog.
mark
from blog.
@pramper 我用的1.0.24似乎还在,2.0+的compile已经写入文档,但功能和1.0+的已经不同
from blog.
@Coffcer 哦~~~
from blog.
你好,我试了下 Object.freeze() 方法,但是传到vue里面后报错,是什么原因?确定可行吗?我也想做这一块的性能优化。是不是Object.freeze()之后的对象,无法用v-for遍历?
from blog.
@liming9515 freeze后,v-for必须自己指定track-by
from blog.
@Coffcer 改完之后好像并没有变快,耗时没有多大改变,如果按照楼主的意思,5-10倍的空间,应该可以很快的,不知道是不是还有什么地方需要注意呢?
from blog.
@liming9515 现在浏览器已经非常快了,所以这种优化只在大数据时或者webview里才有明显效果,我是将 10+ms 优化到 0.x ms,也有十倍了,但这种意义不大
from blog.
@Coffcer 当模板的层次结构相对复杂的时候,比如v-for嵌套2-3层,其中还有v-if组合的情况,在初始化的时候,会出现非常严重的性能问题。不知道这一类的优化有没有接触过,或者你觉得可行的方案有吗?
from blog.
@Coffcer 比如说我有以下的一个模板
<table id="myTable">
<tr v-for="row in rows">
<td v-for="col in cols">
<div v-if="col.format != null" class="grid-content">
{{ col.format(row) }}
</div>
<div v-else class="grid-content">
{{ row[col.name] }}
</div>
</td>
</tr>
</table>
如果我初始化的时候给这个对象 1000条row,5个col,会非常的慢,有什么方式优化吗?或者说我的写法出现了问题?
from blog.
@liming9515 就算是原生js操作dom同时显示1000条row也不会很快,这可能要从产品形态入手,滚动加载或者翻页都行
from blog.
Related Issues (4)
- 使用webpack构建多页面应用 HOT 25
- vue 性能优化 HOT 9
- Node: Puppeteer + 图像识别 实现百度指数爬虫
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from blog.