https://jsfiddle.net/z4vo5u5d/409/
error:
VM212:11 Uncaught ReferenceError: require is not defined
at eval (eval at exec (VM85 typescript.js:41), <anonymous>:11:14)
at exec (VM85 typescript.js:41)
at HTMLDocument.runScripts (VM85 typescript.js:41)
code:
<li (click)="myFunc()" class="tab-link current" data-tab="tab-1">Tab One</li>
var tab_id = $(this).attr('data-tab');
$('ul.tabs li').removeClass('current');
$('.tab-content').removeClass('current');
$(this).addClass('current');
$("#"+tab_id).addClass('current');
}
答案 0 :(得分:0)
您是否在导入部分声明了要求?
declare var require: any;
答案 1 :(得分:0)
它的TSD问题创建本地项目,并更新tsd
#!/usr/bin/env python
import gi
gi.require_version ('Gtk', '3.0')
from gi.repository import Gtk, GdkPixbuf, Gdk, GLib
import os, sys, time
class GUI:
def __init__(self):
window = Gtk.Window()
self.switch = Gtk.Switch()
window.add(self.switch)
window.show_all()
self.switch.connect('state-set', self.switch_activate)
window.connect('destroy', self.on_window_destroy )
def on_window_destroy(self, window):
Gtk.main_quit()
def switch_activate (self, switch, boolean):
if switch.get_active() == True:
GLib.timeout_add(200, self.switch_loop)
def switch_loop(self):
print time.time()
return self.switch.get_active() #return True to loop; False to stop
def main():
app = GUI()
Gtk.main()
if __name__ == "__main__":
sys.exit(main())