// 慢阻肺患者档案-编辑 var template = '' $.ajax('../../../component/statistics/CopdPatientRecordEdit/index/index.html',{ data: {}, dataType: 'html', cache: false, timeout: 60000, async: false, error: function(res) { }, success: function(res) { template = res } }) Vue.component('copd-patient-record-edit', { template: template, props: [], data() { return { } }, methods: { onClickNavLink(id) { var element = document.getElementById(id); var top = element.offsetTop; window.scrollTo({ top: top, behavior: 'smooth' }); } } });