fis-plus icon indicating copy to clipboard operation
fis-plus copied to clipboard

release的自动刷新功能(-L)如何使用?

Open Softor opened this issue 9 years ago • 11 comments

需要安装什么辅助工具到浏览器里吗?(我用的是Chrome)

Softor avatar Mar 13 '15 04:03 Softor

同求,加个-L根本没啥反应。据说有个js文件,但不知道怎么加

ligaofeng0901 avatar Mar 15 '15 11:03 ligaofeng0901

在模版 body 后加上注释 <!--livereload--> 编译不要加 -o

在 2015年3月15日,下午7:50,ligaofeng0901 [email protected] 写道:

同求,加个-L根本没啥反应。据说有个js文件,但不知道怎么加

— Reply to this email directly or view it on GitHub.

oxUnd avatar Mar 15 '15 13:03 oxUnd

{%body%}
    <!-- livereload -->
{%/body%}
{%body%}

{%/body%}
    <!-- livereload -->

“ body 后”指的是哪一种写法? 我尝试以上两种写法,并通过 fisp release -cwLr ./ 本地发布,修改并保存文件,页面也没有刷新。是缺少其他设置吗? (另外发现, 注释内容前后不带空格,这行添加的注释会被模版解析掉。)

Softor avatar Mar 20 '15 06:03 Softor

@xiangshouding @Softor 遇到同样的问题。

5star2014 avatar Mar 20 '15 09:03 5star2014

@xiangshouding 另你们有QQ群之类的即时交流渠道吗?

5star2014 avatar Mar 20 '15 10:03 5star2014

@ligaofeng0901 , @5star2014 : 参考这里:https://github.com/fex-team/fis/issues/109

Softor avatar Mar 20 '15 12:03 Softor

小建议: 在本地调试时,每次待机唤醒后, livereload 的服务器还在运行,可本机的 IP 由于 DHCP 导致更换,都需要手动停掉 -wL 重新 release. 如果本地调试时,引用 livereload.js 的 IP 是 127.0.0.1 就好了。

Softor avatar Mar 25 '15 02:03 Softor

@Softor 如果 FIS 跑在开发机器上,然后在本地去浏览开发的话就无法工作了。

oxUnd avatar Mar 25 '15 02:03 oxUnd

看到fis+里面有个add livereload 的更新 但是就是不知道怎么用

w2230030100 avatar Jun 02 '15 01:06 w2230030100

@w2230030100 现在的实现有点问题,下个版本更正一下;

其实原理很简单,把手动添加 <!--livereload--> 的事情由程序自动做了;之所以要添加 <!--livereload--> 注释因为 FIS 在开启 livereload 功能的时候会把这个注释替换为引入 livereload.js 。

所以你可以手动在你的模板中添加此注释来启用此功能,也可以安装 livereload 浏览器插件来达到同样的效果,插件地址

https://chrome.google.com/webstore/detail/livereload/jnihajbhpnppcggbcgedagnkighmdlei?hl=zh-CN

oxUnd avatar Jun 02 '15 02:06 oxUnd

@xiangshouding 谢谢

w2230030100 avatar Jun 02 '15 02:06 w2230030100