随笔 - 434,  文章 - 0,  评论 - 463,  阅读 - 46万

1.预览模式

更新站点:java小白翻身官网(网址:java18.cn)

更新原因:方便浏览文章,和步骤阅读法相得益彰。

更新内容:PC端在具体的教程页面,目录下方增加一个预览模式的按钮。

点击后会打开一个窗口,里面就是当前的教程,我进行了重新排版。

效果如下:

因为用了vue,我就不需要再重新后台写接口了,改一下html就搞定。

关键代码:

<div style="height:30px;">
	<el-button @click="openPreview" style="float:right;margin-right:10px;">预览模式</el-button>
</div>


<div id="preview" style="display:none;margin:20px;font-size:15px;margin: 0em 1em 0em 1em !important;">

		<div v-for="item in steps">
			<h2 style="color:green;text-align:center;">{{item.stepNum}}.{{item.name}}</h2>
			<div class="step_content" v-html="item.content" v-highlight></div>
		</div>

</div>

JS:

openPreview: function(){
	this.layerId = layer.open({
	    type : 1,
	    area : [ '800px', '600px' ],
	    content : $('#preview')
    });
},

posted on   剽悍一小兔  阅读(20)  评论(0编辑  收藏  举报  
相关博文:
阅读排行:
· DeepSeek 开源周回顾「GitHub 热点速览」
· 物流快递公司核心技术能力-地址解析分单基础技术分享
· .NET 10首个预览版发布:重大改进与新特性概览!
· AI与.NET技术实操系列(二):开始使用ML.NET
· .NET10 - 预览版1新功能体验(一)

< 2025年3月 >
23 24 25 26 27 28 1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30 31 1 2 3 4 5
点击右上角即可分享
微信分享提示